Another prefix problem

J

Jacques

I'm not sure how to address nodes with prefixes when doing a select.
----------------------------------------------------------
<System xmlns="" name="SAP_R3_Financials_DEV200">
<Attributes xmlns="">
<pcd:Attribute name="ApplicationServer" value="secacsap"/>
<pcd:Attribute name="ServerPort" value="3200"/>
</Attributes>
</System>
----------------------------------------------------------
the xsl looks like this:
----------------------------------------------------------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pcd="www.sapportals.com/portal/" version="1.0">
<xsl:eek:utput method="text"/>

<xsl:template match="text()">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>

<xsl:template match="System">
<xsl:value-of select="normalize-space(@name)"/>,<xsl:apply-templates
select="Attributes/pcd:Attribute"/>,
</xsl:template>

<xsl:template match="Attribute">
<xsl:value-of select="@name"/>
</xsl:template>

</xsl:stylesheet>
------------------------------------------------------------
Although no errors are reported, I dont see any of the "Attribute" output.

Is the "<xsl:apply-templates select="Attributes/pcd:Attribute"/>" the
correct way of addressing it? I've trieb Attributes/Attributes also and it
doesn't work either.


Regards
 
P

Philippe Poulard

Jacques said:
I'm not sure how to address nodes with prefixes when doing a select.
----------------------------------------------------------
<System xmlns="" name="SAP_R3_Financials_DEV200">
<Attributes xmlns="">
<pcd:Attribute name="ApplicationServer" value="secacsap"/>
<pcd:Attribute name="ServerPort" value="3200"/>
</Attributes>
</System>
----------------------------------------------------------
the xsl looks like this:
----------------------------------------------------------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pcd="www.sapportals.com/portal/" version="1.0">
<xsl:eek:utput method="text"/>

<xsl:template match="text()">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>

<xsl:template match="System">
<xsl:value-of select="normalize-space(@name)"/>,<xsl:apply-templates
select="Attributes/pcd:Attribute"/>,
</xsl:template>

<xsl:template match="Attribute">
<xsl:value-of select="@name"/>
</xsl:template>

the right element is pcd:Attribute

<xsl:template match="pcd:Attribute">
</xsl:stylesheet>
------------------------------------------------------------
Although no errors are reported, I dont see any of the "Attribute" output.

Is the "<xsl:apply-templates select="Attributes/pcd:Attribute"/>" the
correct way of addressing it? I've trieb Attributes/Attributes also and it
doesn't work either.


Regards


--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
 
P

Philippe Poulard

Jacques said:
Once again you helped a beginner on the right path,

tadaaa !

mission accomplished !

--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top