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
  • Problems with XSL Patterns

    xml regex help learning
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Using xs:Pattern like sql "Like" statement

    database regex
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    3 Posts
    0 Views
    R
    Below is what I did to be able to delete problematic elements(does not conform to schema) from an XML file. 1. In the event handler, I set the innertext of error nodes to 'ERROR' static void Schemas_ValidationEventHandler(object sender, ValidationEventArgs e) { //Get the Schema Validation Exception System.Xml.Schema.XmlSchemaValidationException ex = (XmlSchemaValidationException)e.Exception; //Get the error Xml Node XmlNode node = (XmlNode)ex.SourceObject; //Set the text to ERROR so that it can be removed later //NOTE: trying to delete error nodes here as part of validation causes the validation to break //that is why i used this method of marking problematic nodes and removing them later node.InnerText = "ERROR"; } 2. Then I have a method to remove 'ERROR' nodes. This method along with the Validate() method is called in a loop until there are no more ERROR nodes. The resulting XML document is a document conforming to its schema with all other error nodes deleted. static bool RemoveErrorNodes(XmlDocument xmlDoc) { bool deletedNodes = false; XPathNavigator xpath = xmlDoc.CreateNavigator(); XPathNodeIterator errNodes = xpath.Select("//*"); while (errNodes.MoveNext()) { XPathNodeIterator errNode = errNodes.Current.Select("*[text()='ERROR']"); while (errNode.MoveNext()) { errNode.Current.DeleteSelf(); deletedNodes = true; } } return deletedNodes; }
  • FreeThreadedDOMDocument problem of selectsinglenode

    help announcement
    3
    0 Votes
    3 Posts
    0 Views
    C
    hai led thanks for giving the reply but i have placed the property even though am getting error what i mentioned above.. below is the total code what i have.. Dim xslDoc As MSXML2.FreeThreadedDOMDocument60 Set xslDoc = New MSXML2.FreeThreadedDOMDocument60 xslDoc.setProperty "SelectionLanguage", "XPath" xslDoc.setProperty "SelectionNamespaces", "xmlns:xsl='http://www.w3c.org/1999/XSL/Transform'" xslDoc.setProperty "AllowXsltScript", True xslDoc.async = False xslDoc.validateOnParse = False xslDoc.loadXML strXML xslDoc.selectSingleNode(STR_XPATH_PRIORITY_SORTORDER).nodeValue = " " the last line is giving us error if we have FreeThreadedDOMDocument60.. without 60 its working fine.. thanks chandu.M
  • Xsl problem to find correct nodes using idrefs

    xml help tutorial learning
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Soap Error need help pls !!

    csharp help java wcf com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Converting Data from row to column wise through xsl

    xml help
    2
    0 Votes
    2 Posts
    0 Views
    L
    tarun_codeproject wrote: Can anybody help me out from this issue. Help you with what? You didn't ask a question. led mike
  • Formating XML Output File

    csharp help asp-net database linq
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • xml parser

    question xml help
    3
    0 Votes
    3 Posts
    0 Views
    J
    thank you for your reply :) jyn
  • Generate missing XML

    xml html question
    3
    0 Votes
    3 Posts
    0 Views
    L
    Hi, Thanks for your advice! This has helped me to solve the problem! Best regards, Lea Hayes :-D
  • XML + XSL in a Client Browser

    xml csharp asp-net sysadmin beta-testing
    4
    0 Votes
    4 Posts
    0 Views
    L
    Hi, That's fantastic! I am working on Ajax stuff at the moment, I didn't realize you could do XSL transforms with JavaScript. Thanks for that! :-D Lea Hayes
  • OOXML parsing problem

    question sysadmin cryptography regex xml
    7
    0 Votes
    7 Posts
    0 Views
    L
    Member 4083157 wrote: The problem was in my viewer, which incorret displaid documents. I am glad you resolved the issue, and thanks for posting back your findings. Which viewer were you using? led mike
  • Handling singleclick and doubleclick events on same line

    help
    2
    0 Votes
    2 Posts
    0 Views
    A
    And how do you do propose doing it in XML? Wrong question, wrong forum. Which is why you have had no answers. Bob Ashfield Consultants Ltd
  • XML and performance

    question data-structures xml performance
    6
    0 Votes
    6 Posts
    1 Views
    P
    Thanks, I have tried your suggest, and I have the following result with selectSingleNode(.) call : (ms = milliseconds) /* nb records table load duration last record access time identifier to access ----------------------------------------------------------------------------------- 1000000 75000 ms "999999" ~ 43000 ms 100000 2119 ms "99999" 52 ms 10000 160 ms "9999" 5 ms */ My table looks like : Bigtest 0000000 Guest Guest 0 06.00.00.00.00 true 0000001 Guest Guest 1 06.00.00.00.00 true 0000002 Guest Guest 2 06.00.00.00.00 true ...
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • related search

    4
    0 Votes
    4 Posts
    0 Views
    L
    rose196 wrote: I saw the link but I couldn't understand. It's difficult to believe you can't understand a Google search. On the other hand, if you truly can't then it is likely a waste of time trying to help you.
  • 0 Votes
    7 Posts
    1 Views
    G
    How about something like this? <xsl:variable name="mostCommonTime"> <xsl:for-each select="//fixtures/fixture"> <xsl:sort select="count(time)" order="descending"/> <xsl:if test="position() = 1"> <xsl:value-of select="count(time)"/> </xsl:if> </xsl:for-each> </xsl:variable> modified on Wednesday, October 15, 2008 11:31 PM
  • XML load in C# fails

    csharp xml help question
    3
    0 Votes
    3 Posts
    0 Views
    H
    Sorted it - it was saved in Germany and the numbers in it were in "0,000" format instead of "0.000" and unsurprisingly it barfed.
  • XSD.exe XML question

    question windows-admin xml help tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • XPath Predicates

    xml tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    L
    threemp3 wrote: Don't worry guys, I've found the solution:- whew! What a relief! led mike