<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.6980.72">
<TITLE>RE: [jdom-interest] Question about ElementScanner</TITLE>
</HEAD>
<BODY>
<DIV id=idOWAReplyText71819 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Hi All,</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Is there a way I can ouput the XML string
off a Document, without the first line containing the encoding.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>( The line with <?xml version="1.0"
encoding="UTF-8"?> )</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Iam talking to a external system, which for
some reason does not want the encoding.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Currently this is what I do</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr> public String toString()<BR> {<BR>
XMLOutputter outputter = new XMLOutputter();<BR> return
outputter.outputString(myDocument);<BR> }</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Regards</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Mahesh</DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> jdom-interest-bounces@jdom.org on behalf
of Michael Smith<BR><B>Sent:</B> Mon 3/28/2005 10:42 AM<BR><B>To:</B>
jdom-interest@jdom.org<BR><B>Subject:</B> RE: [jdom-interest] Question about
ElementScanner<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Thanks for all the responses to my question. I did finally get
this working<BR>using Xpath. I was avoiding an XSLT solution because I'd rather
do as much<BR>as I can in Java if possible (personal preference). I'm new to
JDOM, so just<BR>getting my sea legs as to where the boundaries are. I assumed
someone else<BR>had desired to do what I was seeking to do and had already
established a<BR>Java/JDOM solution.<BR><BR>-----Original Message-----<BR>From:
Phil Weighill-Smith [<A
href="mailto:phil.weighill-smith@volantis.com">mailto:phil.weighill-smith@volantis.com</A>]<BR>Sent:
Saturday, March 26, 2005 4:22 PM<BR>To: Phil Weighill-Smith; Michael Smith;
jdom-interest@jdom.org<BR>Subject: RE: [jdom-interest] Question about
ElementScanner<BR><BR>Which then made me think: why not use XSLT
instead?<BR><BR>Phil :n.<BR><BR>
-----Original Message-----<BR> From:
Phil Weighill-Smith<BR> Sent: Sat
26/03/2005 13:50<BR> To: Michael
Smith; jdom-interest@jdom.org<BR>
Cc:<BR> Subject: RE: [jdom-interest]
Question about
ElementScanner<BR> <BR> <BR><BR>
Try using XPath to select all elements you want to replace then<BR>manipulate
these elements via the JDOM
API.<BR> <BR>
E.g. to find all elements called "x" anywhere in a document use the<BR>XPath
"//x", or to find all elements called "x" with an attribute "a" with<BR>the
value "example" you could use the XPath "//x[@a='example']". XPath is<BR>very
powerful for performing potentially conditional selection of
elements,<BR>attributes, text nodes etc. especially if you use the various axes
and<BR>built-in
functions.<BR> <BR>
Phil
:n)<BR> <BR>
-----Original
Message-----<BR>
From: Michael Smith [<A
href="mailto:mikesmi@nc.rr.com">mailto:mikesmi@nc.rr.com</A>]<BR>
Sent: Fri 25/03/2005
16:38<BR>
To:
jdom-interest@jdom.org<BR>
Cc:<BR>
Subject: [jdom-interest] Question
about ElementScanner<BR>
<BR>
<BR>
Hi
there,<BR>
<BR>
I want to create a way to search
through XML documents and<BR>perform a search and replace on certain elements
regardless of their place<BR>in the hierarchy. I'm thinking ElementScanner is
useful here? If so, can<BR>someone point me to an example of its use. If not,
can you suggest<BR>another/better
way?<BR>
<BR>
Thanks,<BR>
<BR>
Mike<BR> <BR> <BR> <BR> <BR><BR>_______________________________________________<BR>To
control your jdom-interest membership:<BR><A
href="http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com">http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com</A><BR></FONT></P></DIV>
</BODY>
</HTML>
<table><tr><td bgcolor=#ffffff><font color=#000000>This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.<br>
<br>
</font></td></tr></table>