Skip to Content.
Sympa Menu

xom-interest - RE: [XOM-interest] XML Serialization

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: r s <rspolitics AT yahoo.com>
  • To: "Jacobs, Robert A." <ra.jacobs AT ngc.com>, xom-interest AT lists.ibiblio.org
  • Cc:
  • Subject: RE: [XOM-interest] XML Serialization
  • Date: Thu, 5 May 2005 13:09:00 -0700 (PDT)

I should clarify, by "serialize" I mean like Axis encode.

I'm currently using Node.toXML and passing this to Axis, is there a better
way to do this?

Thanks!

Ray

"Jacobs, Robert A." <ra.jacobs AT ngc.com> wrote:
Did you check the Serializer class or the Node.toXML() method?

-----Original Message-----
From: xom-interest-bounces AT lists.ibiblio.org
[mailto:xom-interest-bounces AT lists.ibiblio.org] On Behalf Of r s
Sent: Thursday, May 05, 2005 12:14 PM
To: xom-interest AT lists.ibiblio.org
Subject: [XOM-interest] XML Serialization

Hi folks, I'm a junior engineer with a stupid question....

I'm working on a project that requires me to send XML data in a SOAP
envelope (using Axis). The problem that I'm having is that I don't know
how to serialize XOM objects (nodes, etc..). Right now I'm just taking
it to string and then sending that, but this seems kind of hoakey, is
there a way to serialize into "real" xml and not string?

Thanks in advance!
Ray


---------------------------------
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest


---------------------------------
Discover Yahoo!
Stay in touch with email, IM, photo sharing & more. Check it out!
>From passani AT eunet.no Thu May 5 17:21:25 2005
Return-Path: <passani AT eunet.no>
X-Original-To: xom-interest AT lists.ibiblio.org
Delivered-To: xom-interest AT lists.ibiblio.org
Received: from smtp.eunet.no (smtp.eunet.no [195.139.9.42])
by lists.ibiblio.org (Postfix) with ESMTP id 6031C4C00B
for <xom-interest AT lists.ibiblio.org>;
Thu, 5 May 2005 17:21:25 -0400 (EDT)
Received: from [62.211.206.197] (host197-206.pool62211.interbusiness.it
[62.211.206.197])
by smtp.eunet.no (Postfix) with ESMTP id 13C71CD95E;
Thu, 5 May 2005 23:21:23 +0200 (CEST)
Message-ID: <427A8E49.8060306 AT eunet.no>
Date: Thu, 05 May 2005 23:21:13 +0200
From: Luca Passani <passani AT eunet.no>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Elliotte Harold <elharo AT metalab.unc.edu>
Subject: Re: [Fwd: Re: [XOM-interest] need ideas for HTML manipulation]
References: <427A1D55.3080306 AT eunet.no> <427A22F5.9040303 AT metalab.unc.edu>
<427A24EF.4040904 AT eunet.no> <427A306F.5030707 AT metalab.unc.edu>
In-Reply-To: <427A306F.5030707 AT metalab.unc.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: xom-interest <xom-interest AT lists.ibiblio.org>
X-BeenThere: xom-interest AT lists.ibiblio.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: xom-interest.lists.ibiblio.org
List-Unsubscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=unsubscribe>
List-Archive: <https://lists.ibiblio.org/sympa/arc/xom-interest>
List-Post: <mailto:xom-interest AT lists.ibiblio.org>
List-Help: <mailto:sympa AT lists.ibiblio.org?subject=HELP>
List-Subscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=subscribe>
X-List-Received-Date: Thu, 05 May 2005 21:21:25 -0000

Elliotte Harold wrote:

>
>> yeah, that's the idea I was working on too, only problem: it doesn't
>> work. I get a funny error about the
>> file not being well-formed!
>>
>> javax.servlet.ServletException: mark-up is not well-formed.Index: 3,
>> Size: 2
>>
>
> That's not a XOM exception. I'm not sure what's causing it. You're
> probably looking in the wrong place for the fix though.
>
I must be looking in the right place because these are the only lines
that produce the problem:


public Nodes finishMakingElement(Element element) {
:
if (element.getLocalName().equalsIgnoreCase("td") ) {
:
int td_els_count = element.getChildCount();
Node child;
for (int i=0;i<td_els_count;i++) {
child = element.getChild(i);
child.detach();
nds.append(child);
}

The error msg is generated here:

HtmlFactory hf = new HtmlFactory(url, width_int);
org.xml.sax.XMLReader parser = new org.ccil.cowan.tagsoup.Parser();
Builder builder = new Builder(parser, false,hf);

try {
doc = builder.build(url);

}
// indicates a well-formedness error
catch (ParsingException ex) {
throw new ServletException("mark-up is not
well-formed."+ex.getMessage());
}
catch (IOException ex) {
throw new ServletException(ex.getMessage());
}

Luca





Archive powered by MHonArc 2.6.24.

Top of Page