Weird Results in XML

Discussion in 'XML' started by Sparky, Feb 1, 2008.

  1. Sparky

    Sparky Guest

    Greetings:

    I am getting a result via an XStream XML report that looks as follows:
    <owner class="com.mrll.security.LoginVO" reference="../.."/> (Please
    note the reference="../.." portion)

    If you follow the "../.." you end up in the previous node where the
    information I need is in the XML. Is there any w2ay to get this
    information out of this file using XSL?

    Thanks,
    Sparky, Feb 1, 2008
    #1
    1. Advertising

  2. Sparky wrote:

    > I am getting a result via an XStream XML report that looks as follows:
    > <owner class="com.mrll.security.LoginVO" reference="../.."/> (Please
    > note the reference="../.." portion)
    >
    > If you follow the "../.." you end up in the previous node where the
    > information I need is in the XML. Is there any w2ay to get this
    > information out of this file using XSL?


    Well if you know that the reference is ../.. then you can use it as an
    XPath expression in your XSLT stylesheet. However dynamic XPath
    evaluation is not possible thus if you expect to take the reference
    attribute value and construct an XPath expression from it then that does
    not work with standard XSLT/XPath in one stylesheet. You could however
    process the document using one XSLT stylesheet that creates a second
    stylesheet, then you could apply that second stylesheet.



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Feb 2, 2008
    #2
    1. Advertising

  3. Sparky

    Pavel Lepin Guest

    Sparky <> wrote in
    <>:
    > I am getting a result via an XStream XML report that looks
    > as follows: <owner class="com.mrll.security.LoginVO"
    > reference="../.."/> (Please note the reference="../.."
    > portion)


    I would recommend investigating your XML provider to see
    whether it would be possible to convince it to use
    IDs/IDREFs for references instead of this abomination.

    --
    <>There is no phenotype</>
    Pavel Lepin, Feb 4, 2008
    #3
  4. Martin Honnen wrote:
    > Well if you know that the reference is ../.. then you can use it as an
    > XPath expression in your XSLT stylesheet. However dynamic XPath
    > evaluation is not possible


    Well, not with basic XSLT. The EXSLT extension library is available in
    many XSLT processors, and one of its optional modules is dynamic XPath
    evaluation... so that's worth checking.

    If not, then I agree that "styling stylesheets" may be a good solution.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
    Joseph Kesselman, Feb 4, 2008
    #4
  5. Pavel Lepin wrote:
    > I would recommend investigating your XML provider to see
    > whether it would be possible to convince it to use
    > IDs/IDREFs for references instead of this abomination.


    I don't know that I'd call it an abomination... but yes, ID/IDREF (or
    key/keyref if you're working with schemas) is a more common way of
    referencing locations within a single document.


    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
    Joseph Kesselman, Feb 4, 2008
    #5
  6. Sparky

    Pavel Lepin Guest

    Joseph Kesselman <> wrote in
    <47a72662$1@kcnews01>:
    > Pavel Lepin wrote:
    >> I would recommend investigating your XML provider to see
    >> whether it would be possible to convince it to use
    >> IDs/IDREFs for references instead of this abomination.

    >
    > I don't know that I'd call it an abomination... but yes,
    > ID/IDREF (or key/keyref if you're working with schemas) is
    > a more common way of referencing locations within a single
    > document.


    Well, I'm thinking in terms of XSLT processing, as the OP
    seemed to, - and we still don't have first-class XPath
    expressions, even in XSLT2.

    Besides, I think this particular application (using, as you
    said, EXSLT for example) is a can of worms better left
    unopened. For one thing, it's not humanly possible to
    preserve the references of this kind if we're doing
    anything non-trivial with the input document; while the
    same task is largely a no-brainer using IDs/IDREFs.

    --
    <>There is no phenotype</>
    Pavel Lepin, Feb 4, 2008
    #6
    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. dorayme
    Replies:
    1
    Views:
    602
    richard
    Jan 21, 2011
  2. richard
    Replies:
    0
    Views:
    571
    richard
    Jan 21, 2011
  3. richard
    Replies:
    0
    Views:
    604
    richard
    Jan 21, 2011
  4. Beauregard T. Shagnasty

    Re: A Weird Appearance for a Weird Site

    Beauregard T. Shagnasty, Jan 21, 2011, in forum: HTML
    Replies:
    1
    Views:
    425
    Captain Paralytic
    Jan 21, 2011
  5. Erik Wasser
    Replies:
    5
    Views:
    429
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page