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

XML markup being output during XSL transformation

Expand Messages
  • Fournier,Danny [NCR]
    I m wondering why in this example, that the XML markup gets rendred along with the actual value of the tag? I m assuming that it s because of the copy-of ?
    Message 1 of 2 , Nov 17, 2005
      I'm wondering why in this example, that the XML markup gets rendred
      along with the actual value of the tag? I'm assuming that it's because
      of the "copy-of" ? I've included a snippet of code to show you what I
      mean.

      I'm also using:
      MSXML2.DOMDocument.4.0
      MSXML2.FreeThreadedDOMDocument.4.0

      I'm getting no error and things are working correctly in regards to the
      parameters passed.

      -- Code --

      [XML]
      <responseTitle>
      <txt xml:lang="en">English title:</txt>
      <txt xml:lang="fr">French title :</txt>
      </responseTitle>

      <ministerResponse>
      <txt xml:lang="en">English text</txt>
      <txt xml:lang="fr">French text</txt>

      </ministerResponse>

      [XSL]
      <fo:block padding-after="16pt">
      <fo:inline font-weight="bold">
      <xsl:value-of
      select="document($titlePath)/root/responseTitle/txt[lang($language)]"/>
      </fo:inline>
      <xsl:copy-of
      select="info/ministerResponse/txt[lang($language)]"/>
      </fo:block>

      [Render] (notice xml tag markup that gets output)
      <fo:block padding-after="16pt">
      <fo:inline font-weight="bold">
      English Title:
      </fo:inline>
      <txt xml:lang="en">English text</txt>
      </fo:block>

      Best regards,

      Dan


      [Non-text portions of this message have been removed]
    • Chris Bowditch
      ... You have answered your own question! The copy-of XSL function says copy the node selected by the XPath statement into the output XML Tree. So its no
      Message 2 of 2 , Nov 18, 2005
        Fournier,Danny [NCR] wrote:

        > I'm wondering why in this example, that the XML markup gets rendred
        > along with the actual value of the tag? I'm assuming that it's because
        > of the "copy-of" ? I've included a snippet of code to show you what I
        > mean.

        You have answered your own question! The copy-of XSL function says copy
        the node selected by the XPath statement into the output XML Tree. So
        its no surprise to see the txt element in the result XML.

        <snip/>

        Chris
      Your message has been successfully submitted and would be delivered to recipients shortly.