Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Aug 24, 2010 @ 17:19
    Ismail Mayat
    0

    New schema issue

    I am having an issue trying to get value of property in new schema,

    the oldway the query would be $currentPage/ancestor-or-self::node/data[@alias=$NavSource]

    I am trying the following

    $currentPage/ancestor-or-self::node/*[name()=$NavSource]

    and tried

    $currentPage/ancestor-or-self::*[name()=$NavSource]

    no joy

    Any ideas?

    Regards

    Ismail

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Aug 24, 2010 @ 17:29
    Warren Buckley
    1

    I would say that this should work, so what is the value of NavSource does it actually match any of your document type aliases or document type property aliases?

    $currentPage/ancestor-or-self::*[name()=$NavSource]
  • Sjors Pals 617 posts 270 karma points
    Aug 24, 2010 @ 17:31
    Sjors Pals
    0

    I think Warren is right....

    Maybe debug it with VS or otherwise in code with <xsl-copy-of select"$NavSource" />

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Aug 24, 2010 @ 17:36
    Ismail Mayat
    0

    Warren,

    $currentPage/*[name()=$NavSource]

    works

    looks like when using ancestor-or-self im missing something?

    Rgards

    Ismail

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Aug 24, 2010 @ 17:58
    Warren Buckley
    2

    OK after a quick chat with Ismail on MSN this is the solution that he needed

    $currentPage/ancestor-or-self::* [@isDoc]/*[name()=$NavSource]

     

     

    You need to go up the ancestor tree to find all the nodes that are document types that have the isDoc attribute on the xml node, then for each of them we look at the child nodes of that document type (xml node) which is where the document type properties are stored so we look through them to match the name in the variable NavSource

    Warren :)

Please Sign in or register to post replies

Write your reply to:

Draft