Hi Marc
I guess I'm trying to understand what you want. Do you want all of the XML
as a single String including markup? Or do you want just the text content
and loose the markup? Or preserve the XML as a tree of Element and Text
nodes?
James
----- Original Message -----
From: "Marc Elliott" <[EMAIL PROTECTED]>
To: "James Strachan" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 2:25 PM
Subject: RE: [dom4j-user] database to document OK, but document to
database...
> So I guess it depends on what you want to do. Are you trying
> to output the
> XML of whats inside the <intro> XML without the <intro> tag?
> If so this
> should do the trick fine...
>
> Writer out = new FileWriter( "foo.xml" );
> for ( Iterator iter = intro.nodeIterator(); iter.hasNext(); ) {
> Node node = (Node) iter.next();
> node.write( out );
> }
This is closer to what I need to do, but how would it handle situations
where the contents were mixed? like this:
<intro>
More, content, contentcontent, contentcontent
<p><b>Content, content, content</b></p>
<p>More, content, contentcontent, contentcontent,
contentcontent, contentcontent, contentcontent, contentcontent,
contentcontent, contentcontent, contentcontent, contentcontent,
contentcontent, contentcontent, contentcontent, contentcontent,
contentcontent, <some other tag>contentcontent</some other tag>,
contentcontent, contentcontent, contentcontent, contentcontent,
content</p>
</intro>
... would the copy within the intro tags, but not within any others be
treated as if it were a node?
>
> James
> ----- Original Message -----
> From: "Marc Elliott" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 01, 2001 2:06 PM
> Subject: [dom4j-user] database to document OK, but document
> to database...
>
>
> Hi folks,
>
> I've done pretty well getting dom4j to take content from my
> database and
> construct a document object and then an XML file, but I'm having a bit
> of a trouble getting the data I need out of a document and
> putting into
> the database.
>
> The problem appears to be rooted in the fact that my XML documents are
> somewhat unstructured with mixed content at different levels.
>
> For example:
>
> <intro>
> <p><b>Content, content, content</b></p>
> <p>More, content, contentcontent, contentcontent,
> contentcontent, contentcontent, contentcontent, contentcontent,
> contentcontent, contentcontent, contentcontent, contentcontent,
> contentcontent, contentcontent, contentcontent, contentcontent,
> contentcontent, <some other tag>contentcontent</some other tag>,
> contentcontent, contentcontent, contentcontent, contentcontent,
> content</p>
> </intro>
>
> If I grab this content using the asXML method on the intro node, the
> <intro> tags come with it, and I don't want them to. But if I use the
> getText or the getValueOf method, it won't return anything in the <p>
> tags. Is there a better way to go about this?
>
> Thanks,
>
> Marc
>
> ..................................................
>
> Marc Elliott
> Director of Information Architecture / HNW Inc.
> Digital Solutions for High-Net-Worth Marketers
> ph: 617-243-9199 x224
> fx: 815-327-4167
>
>
> _______________________________________________
> dom4j-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dom4j-user
>
>
>
>
> _________________________________________________________
>
> Do You Yahoo!?
>
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user