[Home] [By Thread] [By Date] [Recent Entries]
Robert Van Gemert wrote:
I am using msxml3 and am having difficulty parsing namespace elements, I need to get the value of the NSML fields <mos> <mosID>gvg.auroraplay.mos</mosID> <ncsID>MNEWS</ncsID> <roStorySend> <roID>MNEWS/TVNEWS.AUSNET.RUNDOWNS-IGNITE.AM-TWO</roID> <storyID>492893613</storyID> <storySlug>1130 AUSNET 030809</storySlug> <storyNum></storyNum> <mosExternalMetadata> <mosPayload>coding=3D"utf-16"?> <nsml:nsml xmlns:nsml=3D"http://www.inewsroom.com"> ^^^^^^^^^^^^^^^^^^^^^^^^^ So here the URL is http://www.inewsroom.com. [snip]My stylesheet is:^^^^^^^^^^^^^^^^^^^ while here you use a completely different URL. You can choose a different prefix in the XML and in the stylesheet but in your stylesheet you will need to bind a prefix to the URL used in the XML if your stylesheet needs to select/match elements in that namespace. So use e.g. xmlns:nsml="ttp://www.inewsroom.com" in the stylesheet. <xsl:template match=3D"/"> <xsl:for-each select=3D"//mosPayload/nsml:fields/f"> <xsl:for-each select="mos/roStorySend/mosExternalMetadata/mosPayload/nsml:nsml/nsml:fields/nsml:f"> should process the nsml:f elements in your XML input. -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|

Cart



