File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Attribute of a xml tag should contain content of a xml file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Attribute of a xml tag should contain content of a xml file." Watch "Attribute of a xml tag should contain content of a xml file." New topic
Author

Attribute of a xml tag should contain content of a xml file.

shiva kumar
Greenhorn

Joined: Aug 22, 2006
Posts: 7
I have a requirement where i have to put a complete xml file content into a attribute of another xml tag.

i.e

<BookConfig attribute1="should contain data of another xml file"/>

For example the following xml should be in the content of the detail attribute of BookConfig tag...
<books>
<book name="b1"> <price> 50 </price> </book>
<book name="b2"> <price> 20 </price> </book>
</books>

Please help and let me know how this can be done...
Waiting for Reply
Thanks in Advance.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18141
    
    8

Can't be done. And it's a really bad idea anyway. Parsers are required to "normalize" attributes by removing new-line characters and replacing blocks of whitespace by a single space character. This normalization would change the data stored in the attribute, perhaps in a significant way.

So don't do that. Store it as a text node.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Attribute of a xml tag should contain content of a xml file.
 
Similar Threads
taglib JSP 2.0 problem
problem with tld file
Custom Tag Parameters as values from other Custom Tags
XML certification Success - XPath examples
XML Certification Notes