Another prefix problem

Discussion in 'XML' started by Jacques, Jun 24, 2004.

  1. Jacques

    Jacques Guest

    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
     
    Jacques, Jun 24, 2004
    #1
    1. Advertising

  2. Jacques wrote:
    > 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: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
    >
    >
    >



    --
    Cordialement,

    ///
    (. .)
    -----ooO--(_)--Ooo-----
    | Philippe Poulard |
    -----------------------
     
    Philippe Poulard, Jun 24, 2004
    #2
    1. Advertising

  3. Jacques

    Jacques Guest

    Once again you helped a beginner on the right path,

    thanks


    Regards

    "Philippe Poulard" <> wrote in message
    news:cbe2g9$13m$...
    > Jacques wrote:
    > > 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: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
    > >
    > >
    > >

    >
    >
    > --
    > Cordialement,
    >
    > ///
    > (. .)
    > -----ooO--(_)--Ooo-----
    > | Philippe Poulard |
    > -----------------------
     
    Jacques, Jun 24, 2004
    #3
  4. Jacques wrote:
    > Once again you helped a beginner on the right path,


    tadaaa !

    mission accomplished !

    --
    Cordialement,

    ///
    (. .)
    -----ooO--(_)--Ooo-----
    | Philippe Poulard |
    -----------------------
     
    Philippe Poulard, Jun 24, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Asra
    Replies:
    1
    Views:
    4,341
    Sudsy
    Oct 26, 2004
  2. Tim Tyler
    Replies:
    36
    Views:
    1,473
    Darryl L. Pierce
    Dec 10, 2004
  3. Jacques

    Prefix problem with XML/XSL

    Jacques, Jun 23, 2004, in forum: XML
    Replies:
    3
    Views:
    463
    Jacques
    Jun 23, 2004
  4. Chris  Chiasson
    Replies:
    6
    Views:
    625
    Richard Tobin
    Nov 14, 2006
  5. Ryan Liu
    Replies:
    0
    Views:
    308
    Ryan Liu
    May 26, 2008
Loading...

Share This Page