Re: [xsl] namespace syntax

Subject: Re: [xsl] namespace syntax
From: "Robert Van Gemert" <rcvangemert@xxxxxxxxxxxxxxxx>
Date: Wed, 5 Aug 2009 10:19:51 +1000

So use e.g. xmlns:nsml=
that did it, many thanks


----- Original Message ----- From: "Martin Honnen" <Martin.Honnen@xxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, August 04, 2009 10:44 PM
Subject: Re: [xsl] namespace syntax

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

 <storySlug>1130 AUSNET 030809</storySlug>
   <nsml:nsml xmlns:nsml=3D"";>
So here the URL is

     <nsml:meta words=3D"1" rate=3D"180" break=3D"yes"></nsml:meta>
     <nsml:rgroup number=3D"2"></nsml:rgroup>
     <nsml:wgroup number=3D"6"></nsml:wgroup>
     <nsml:formname>TVNEWS-2            </nsml:formname>
     <nsml:f id=3D"page-number"></nsml:f>
     <nsml:f id=3D"title">1130 AUSNET 030809</nsml:f>

My stylesheet is:

<?xml version=3D"1.0"?>
<xsl:stylesheet version=3D"1.0" =
xmlns:xsl=3D""; =
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.
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

Current Thread