Loading ...
Sorry, an error occurred while loading the content.

namespace

Expand Messages
  • Laurent
    Hi, I received following (snip) xml-file: 1 t
    Message 1 of 5 , Nov 4, 2003
    • 0 Attachment
      Hi,

      I received following (snip) xml-file:
      <data>
      <elem1>1</elem1>
      <test>t</test>
      <kid xmlns="http://www.mysite.com/administration">
      < ... some other elements ... />
      </kid>
      </data>

      I don't doubt that the usage of the namespace here is wrong or not
      needed, but I have to work with it :(
      Anyway, my xsl-fo file seems not to find the "kid" element:

      [snip]
      <fo:block>
      <xsl:apply-templates select="kid">
      </fo:block>

      ...

      <xsl:template match="kid">
      <fo:block>Kid detected</fo:block>
      </xsl:template>

      If, however, I remove the attribute "xmlns", then the "Kid" element
      is found. But how to detect the kid when the attribute "xmlns" is
      present?

      Regards,
      Laurent.
    • Chris Bowditch
      ... Declare this namespace on your stylesheet element, e.g. ... change this to
      Message 2 of 5 , Nov 4, 2003
      • 0 Attachment
        >From: "Laurent" <ld_orange13@...>
        >
        >Hi,
        >
        >I received following (snip) xml-file:
        ><data>
        > <elem1>1</elem1>
        > <test>t</test>
        > <kid xmlns="http://www.mysite.com/administration">

        Declare this namespace on your stylesheet element, e.g.


        <xsl:stylesheet xmlns:admin="http://www.mysite.com/administration" ...

        <snip/>

        ><fo:block>
        > <xsl:apply-templates select="kid">

        change this to

        <xsl:apply-templates select="admin:kid"/>

        ></fo:block>
        >
        >...
        >
        ><xsl:template match="kid">

        and this to <xsl:template match="admin:kid">

        > <fo:block>Kid detected</fo:block>
        ></xsl:template>
        >

        Chris

        _________________________________________________________________
        Express yourself with cool emoticons - download MSN Messenger today!
        http://www.msn.co.uk/messenger
      • Laurent
        Hi Chris, Thanks a lot for the help; it works fine now! Btw. was this some basic stuff about namespaces ??? Did not know about it ... Regards, Laurent. ...
        Message 3 of 5 , Nov 4, 2003
        • 0 Attachment
          Hi Chris,

          Thanks a lot for the help; it works fine now!
          Btw. was this some 'basic' stuff about namespaces ???
          Did not know about it ...

          Regards,
          Laurent.

          --- In XSL-FO@yahoogroups.com, "Chris Bowditch" <bowditch_chris@h...>
          wrote:
          > >From: "Laurent" <ld_orange13@y...>
          > >
          > >Hi,
          > >
          > >I received following (snip) xml-file:
          > ><data>
          > > <elem1>1</elem1>
          > > <test>t</test>
          > > <kid xmlns="http://www.mysite.com/administration">
          >
          > Declare this namespace on your stylesheet element, e.g.
          >
          >
          > <xsl:stylesheet
          xmlns:admin="http://www.mysite.com/administration" ...
          >
          > <snip/>
          >
          > ><fo:block>
          > > <xsl:apply-templates select="kid">
          >
          > change this to
          >
          > <xsl:apply-templates select="admin:kid"/>
          >
          > ></fo:block>
          > >
          > >...
          > >
          > ><xsl:template match="kid">
          >
          > and this to <xsl:template match="admin:kid">
          >
          > > <fo:block>Kid detected</fo:block>
          > ></xsl:template>
          > >
          >
          > Chris
          >
          > _________________________________________________________________
          > Express yourself with cool emoticons - download MSN Messenger
          today!
          > http://www.msn.co.uk/messenger
        • Ryan Graham
          ... Yes it is. When you have unprefixed namespaces in your source XML, you need to define them with a prefix in your stylesheet for them to be recognized by
          Message 4 of 5 , Nov 4, 2003
          • 0 Attachment
            >Thanks a lot for the help; it works fine now!
            >Btw. was this some 'basic' stuff about namespaces ???
            >Did not know about it ...

            Yes it is. When you have unprefixed namespaces in your source XML, you need
            to define them with a prefix in your stylesheet for them to be recognized by
            the parser.

            HTH,
            RG
          • Laurent
            Yes, it seems logic to me now ... :) Thanks for the head-up. Regards, Laurent. ... you need ... recognized by
            Message 5 of 5 , Nov 5, 2003
            • 0 Attachment
              Yes, it seems logic to me now ... :)
              Thanks for the head-up.

              Regards,
              Laurent.

              --- In XSL-FO@yahoogroups.com, Ryan Graham <ryan.graham@a...> wrote:
              >
              > >Thanks a lot for the help; it works fine now!
              > >Btw. was this some 'basic' stuff about namespaces ???
              > >Did not know about it ...
              >
              > Yes it is. When you have unprefixed namespaces in your source XML,
              you need
              > to define them with a prefix in your stylesheet for them to be
              recognized by
              > the parser.
              >
              > HTH,
              > RG
            Your message has been successfully submitted and would be delivered to recipients shortly.