Skip to content

XML / XSL

Discussions on XML and related technologies

This category can be followed from the open social web via the handle xml-xsl@forum.codeproject.com

2.6k Topics 6.8k Posts
  • How do I move XML nodes?

    csharp question asp-net data-structures xml
    2
    0 Votes
    2 Posts
    0 Views
    Richard DeemingR
    Try something like: XmlNode MoveNode(XmlNode nodeToMove, XmlNode newParent) { // Check we have some values: if (null == nodeToMove) throw new ArgumentNullException("nodeToMove"); if (null == newParent) throw new ArgumentNullException("newParent"); // Are we moving within the same document? if (nodeToMove.OwnerDocument == newParent.OwnerDocument) { // Check that the new parent is not a // child of the node we are moving: XmlNode temp = newParent; while(null != temp) { if (temp == nodeToMove) throw new InvalidOperationException(); temp = temp.ParentNode; } // Remove the node from its old parent: if (null != nodeToMove.ParentNode) nodeToMove.ParentNode.RemoveChild(nodeToMove); // Add the node to the new parent: return newParent.AppendChild(nodeToMove); } else { // Import the node to the new document XmlNode newNode = newParent.OwnerDocument.ImportNode(nodeToMove, true); // Remove the node from its old parent: if (null != nodeToMove.ParentNode) nodeToMove.ParentNode.RemoveChild(nodeToMove); // Add the imported node to the new parent: return newParent.AppendChild(newNode); } } "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • Seti@Home XML/DTD

    ai-models xml tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • where does the meta tag come from?

    xml html question
    3
    0 Votes
    3 Posts
    0 Views
    P
    this is happening because of the way you are specifying the transformation. the code is guessing that you want UTF-16. check your <xsl:output encoding=""/> "When the only tool you have is a hammer, a sore thumb you will have."
  • Output XML->HTML

    html xml help question
    3
    0 Votes
    3 Posts
    0 Views
    J
    Open the XML doc in Internet Explorer. Select-all, then copy. Open up Frontpage, then paste. Simple, huh? "Do unto others as you would have them do unto you." - Jesus "An eye for an eye only makes the whole world blind." - Mahatma Gandhi
  • XSL tag matching

    question tools regex xml help
    10
    0 Votes
    10 Posts
    0 Views
    J
    Yep. That's what I'm doing. Thanks! "Do unto others as you would have them do unto you." - Jesus "An eye for an eye only makes the whole world blind." - Mahatma Gandhi
  • XSLT Problem-again

    xml help
    2
    0 Votes
    2 Posts
    0 Views
    P
    put the condition in your for: <xsl:for-each select="FIELD[@NAME = 'ric']"> "When the only tool you have is a hammer, a sore thumb you will have."
  • CrLf in XML quoted string

    xml help tutorial question
    3
    0 Votes
    3 Posts
    2 Views
    J
    This is what I had thought, but when I do it that way, my whole XML file's display goes nuts. I am just doing an XML file by hand with an XSLT transform. Thanks for your help! "Do unto others as you would have them do unto you." - Jesus "An eye for an eye only makes the whole world blind." - Mahatma Gandhi
  • XSLT Problem

    xml help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • error C2065: 'IXMLDOMDocument3' : undeclared identifier

    help html com xml tutorial
    2
    0 Votes
    2 Posts
    4 Views
    S
    Did you install the MSXML 4 SDK ? (see MS platform SDK site for the update). Once installed, you still need to add the path to the msxml2.lib file in either your project settings (additional library path), or your VisualStudio general directories (tools / options / directories).
  • Selection based on more than one condition

    xml question tutorial
    3
    0 Votes
    3 Posts
    0 Views
    E
    Thanks. Why did I not think of the simplest solution? For the select case the following turned out to work: i.e. just adding up the conditions. /EnkelIk
  • Seeking XML-Based Help System for Web Site

    csharp database xml help question
    2
    0 Votes
    2 Posts
    2 Views
    P
    A Dynamic Index: Reinventing the Online Help in XML http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml04212003.asp[^] "When the only tool you have is a hammer, a sore thumb you will have."
  • Small XML/C# problem...

    csharp help question asp-net xml
    13
    0 Votes
    13 Posts
    23 Views
    P
    you don't need System.Xml.XmlNode xmlnode = xml.SelectSingleNode("descendant::root/path"); use: System.Xml.XmlNode xmlnode = xml.SelectSingleNode("/options"); "When the only tool you have is a hammer, a sore thumb you will have."
  • MADNESS

    xml help question
    4
    0 Votes
    4 Posts
    2 Views
    P
    string filePath = null; "When the only tool you have is a hammer, a sore thumb you will have."
  • SelectNodes

    tutorial question xml
    4
    0 Votes
    4 Posts
    0 Views
    P
    node.selectNodes("*/*[name() != '" + myVar + "']").length "When the only tool you have is a hammer, a sore thumb you will have."
  • MSXML parser and internet explorer

    question xml announcement
    2
    0 Votes
    2 Posts
    2 Views
    S
    There are two ways to use xml in Internet Explorer - loading a document with .xml as file extension. The MSXML parser version used to parse the xml file, transform it using a xslt stylesheet, is hardcoded. You must upgrade Internet Explorer to use a different MSXML parser. - writing JScript/VBScript code to create a COM instance of the MSXML parser within a web page. Since it's up to you to pass the progid of this object, you can choose whichever MSXML parser that might be installed. For instance, "Msxml2.DOMDocument.4.0" instead of "Microsoft.XmlDOM". A sample JScript[^] code.
  • 0 Votes
    3 Posts
    2 Views
    X
    Thanks!!!
  • Access Denied when saving DOM document in JS

    javascript xml help c++ html
    3
    0 Votes
    3 Posts
    2 Views
    J
    I was writing an editor, using the XSLT bound to an XML document to generate a HTML form, which used Javascript to tie into a XML DOM. I wanted to be able to save, and I found a way using a FileSystemObject activex control, but I was just wondering why I couldnt save using the Javascript. Thanks Jesse Rosalia
  • C#/XML file naming problem

    csharp asp-net xml help question
    8
    0 Votes
    8 Posts
    2 Views
    E
    Wait, nevermind... I figured it out myself... string fileName = DateTime.Now.ToString("yyyyMMdd_hhmm") + ".xml"; XmlTextWriter writer = new XmlTextWriter("C:/inetpub/wwwroot/weblog/entries/"+ fileName, null); /\ |_ E X E GG
  • Converting XML-string into Dataset

    sysadmin xml help tutorial question
    5
    0 Votes
    5 Posts
    12 Views
    P
    This one also works fine - thanks. Preben Rasmusen
  • Help with XSL

    xml question html help
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied