XSL Transformation

Discussion in 'XML' started by RG, Nov 9, 2007.

  1. RG

    RG Guest

    My xml document contains an entity with one string atribute. This string
    attribute in turn contains an xml document. How can I then include the
    contents of this attribute for xpath reference?

    Thanks in advance
     
    RG, Nov 9, 2007
    #1
    1. Advertisements

  2. RG wrote:
    > My xml document contains an entity with one string atribute. This
    > string attribute in turn contains an xml document. How can I then
    > include the contents of this attribute for xpath reference?


    Not easily. XPath and XSLT (and XML itself) have no concept of XML
    contained within the text fields of XML. If your processor supports it,
    you might be able to pass the attribute's contents out to an extension
    function which re-parses it.

    A better answer would be "Stop doing that. If you want XML content, make
    it an XML subtree rather than text."


    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, Nov 9, 2007
    #2
    1. Advertisements

  3. RG

    RG Guest

    Thanks for your help.

    The problem is that it is fed as text field. It is retrieved from db.

    Can you create a subtree from a text field?

    Thanks again
    "Joe Kesselman" <> wrote in message
    news:...
    > RG wrote:
    >> My xml document contains an entity with one string atribute. This string
    >> attribute in turn contains an xml document. How can I then include the
    >> contents of this attribute for xpath reference?

    >
    > Not easily. XPath and XSLT (and XML itself) have no concept of XML
    > contained within the text fields of XML. If your processor supports it,
    > you might be able to pass the attribute's contents out to an extension
    > function which re-parses it.
    >
    > A better answer would be "Stop doing that. If you want XML content, make
    > it an XML subtree rather than text."
    >
    >
    > --
    > () ASCII Ribbon Campaign | Joe Kesselman
    > /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    RG, Nov 9, 2007
    #3
  4. RG wrote:
    > My xml document contains an entity with one string atribute. This
    > string attribute in turn contains an xml document. How can I then
    > include the contents of this attribute for xpath reference?


    Some XSLT processors have extension functions for such a task e.g.
    <URL:http://www.saxonica.com/documentation/extensions/functions/parse.html>


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Nov 9, 2007
    #4
  5. RG wrote:
    > Can you create a subtree from a text field?


    Not reasonably in pure XSL (not unless you want to try to write an XML
    parser in XSLT string processing, a task I REALLY don't recommend).

    As I and others have said, you may be able to find -- or you can to
    write and plug in -- an extension function to do this.

    Or you can fix the code where the document is being generated. Which
    really is going to be a better answer in the long run.


    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, Nov 9, 2007
    #5
    1. Advertisements

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. George Durzi

    Timeout on Xsl Transformation

    George Durzi, Dec 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    566
    George Durzi
    Dec 29, 2003
  2. Hugo Ferreira
    Replies:
    0
    Views:
    414
    Hugo Ferreira
    Jul 14, 2004
  3. George Durzi

    Nested DataSet / Xsl Transformation

    George Durzi, Mar 24, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,149
    George Durzi
    Mar 24, 2005
  4. Replies:
    1
    Views:
    3,772
    A. Bolmarcich
    May 27, 2005
  5. Replies:
    0
    Views:
    611
Loading...

Share This Page