• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
shiva kumar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 20990
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic