Copied to clipboard

Flag this post as spam?

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


  • Webious 22 posts 26 karma points
    Mar 18, 2009 @ 13:31
    Webious
    0

    Retrieving XML data from a node property using XSLT

    I have a user control which serializes a List<> and stores the data in a node property as XML. so my node/data [@alias = 'nodeAssociation'] contains the following value:




    for some reason, I cannot work with this XML data in my XSLT. i.e.

    Works




    never works. does any one know of a way i could this?

  • Casey Neehouse 1339 posts 483 karma points MVP 2x admin
    Mar 18, 2009 @ 14:38
    Casey Neehouse
    0

    It is storing into the node as text. In your data type, you will need to override the ToXml to be a node, versus a text object.

    [code]
    public override XmlNode ToXMl(System.Xml.XmlDocument xd)
    {
    if ((base.Value + "") != "")
    {
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(base.Value.ToString());

    XmlElement xe = xd.CreateElement(doc.SelectSingleNode("/Pair").Name);

    xe.InnerXml = doc.SelectSingleNode("/Pair").InnerXml;
    return xe;
    }
    return xd.CreateTextNode("");
    }
    [/code]

    This can probably be cleaned up a bit, but, I broke it down when having a problem at one point.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies