• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get value of an xml node which contains another xml

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I get value of an XML node which is internally represents another XML.
My xml :-

<?xml version="1.0"?>
<Entity name = "RuleSetInfo">
<Column name="definition">
<RuleSet>
<Product comment="" id="PRODUCT_10" legislationbase="" producttype="RT1">
<Label highlightonfailure="true">
<RuleName>
<Text locale="en_US" value="Liability Overbilling"/>
</RuleName>
<SuccessText>
<Text locale="en_US" value="Product Succeeded"/>
</SuccessText>
</Product>
</RuleSet>
</Column>
</Entity>

I want to retrieve value inside the <Column> VALUE</Column> tag and I am using SAX parser.

VALUE:- represents another XML which is
<RuleSet>
<Product comment="" id="PRODUCT_10" legislationbase="" producttype="RT1">
<Label highlightonfailure="true">
<RuleName>
<Text locale="en_US" value="Liability Overbilling"/>
</RuleName>
<SuccessText>
<Text locale="en_US" value="Product Succeeded"/>
</SuccessText>
</Product>
</RuleSet>
How can I get this inner XML as VALUE of <Column> node?

Regards,
sahidul
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you say you want to "get" the XML, exactly what do you mean by that? Do you want the XML rendered as text, or in some internal form, or what?
 
sahidul karim
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to get that xml as a textual representation ( I need to store the vale as a string).
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems to me that all you need to do is start a new StringBuffer when you get the startElement event.
Collect what you need from the following events in the StringBuffer until you hit the endElement event and bingo.

Bill
reply
    Bookmark Topic Watch Topic
  • New Topic