This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: How to normalize XML???


> > 
> > Is there any way in Xerces or JAXP API to
> normalize
> > the spaces from the XML.
> > <Source>
> >    <Arg>some text</Arg>
> > </Source>
> > I have an indented XML as above and whenever I
> parse
> > it, I expect single child under Source node but it
> > give me nodelist of 3 elements just because my xml
> is
> > indented.
> > 
> > Do I need to write my xml inline, or check the
> element
> > type for every node ???
> > 

there's a better xpath for this then the one I'm going to give you now,
but I can't remember it so here goes:

child::node()[name()!='']

although if you're always dealing with <Arg> then you should just select
for <Arg>

normalize() normalizes the text.





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]