User Profile

Collapse

Profile Sidebar

Collapse
ajc308
ajc308
Last Activity: Aug 14 '07, 12:24 PM
Joined: Jul 18 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ajc308
    started a topic C# string.split()
    in .NET

    C# string.split()

    I have a text file that I am reading in, and on some of the lines, there are multiple numbers that need to be read into seperate variables. The problem I am having, is that sometimes, the numbers are separated by a single space, sometimes multiple spaces, and sometimes tabs.

    So if I have something like the following:
    Code:
    -18519.65	 -100000	-500
    0.0		30.9946	10.0
    -18619.65	-97500	-550
    0.00        30.9846
    ...
    See more | Go to post

  • ajc308
    started a topic XSL Copy Problem
    in XML

    XSL Copy Problem

    I'm attempting to sort the <file>s within each <directory> in my XML according to their file extension, then write out the resulting sorted data back to XML format. I had it working before, and when I opened up the file the next day, the XSL behaved completely different. I don't know if I accidentally changed something, but I can't see any problems with my code.

    My Sample XML:

    Code:
    <root name="PlanRepository">
    ...
    See more | Go to post

  • ajc308
    replied to XmlTextWriter to XmlDocument
    in XML
    For anyone that may have this problem in the future, this is how I solved it:

    Code:
    XslCompiledTransform myXslTrans = new XslCompiledTransform();
    myXslTrans.Load("sortByExtension.xsl");
    StringBuilder XmlStringBuilder = new StringBuilder();
    XmlWriter myXmlWriter = XmlWriter.Create(XmlStringBuilder);
    myXslTrans.Transform(TreeViewXML, null, myXmlWriter);
    XmlDocument sortedXML = new
    ...
    See more | Go to post

    Leave a comment:


  • ajc308
    started a topic XmlTextWriter to XmlDocument
    in XML

    XmlTextWriter to XmlDocument

    My current code contains a hardcoded filename for the XmlTextWriter to write to, and then an XmlDocument loads that file. I am looking to replace the hardcoded filename with something, anything that will retain the contents that the XmlTextWriter outputs.

    My code:
    Code:
    XslCompiledTransform myXslTrans = new XslCompiledTransform();
    myXslTrans.Load("sortByExtension.xsl");
    
    XmlTextWriter XmlWrite
    ...
    See more | Go to post

  • ajc308
    replied to XSL to XML &lt; to < problem
    in XML
    That worked! Thanks so much for going through this process with me and helping me figure it out. I really appreciate it.

    Andrew
    See more | Go to post

    Leave a comment:


  • ajc308
    replied to XSL to XML &lt; to < problem
    in XML
    Yes, in both cases, replacing the &lt; and &gt; with < and > causes errors.

    This is the error I get:

    Code:
    System.Xml.Xsl.XslLoadException: XSLT compile error. ---> System.Xml.XmlException: '&lt;', hexadecimal value 0x3C, is an invalid attribute character. Line 11, position 22.
    See more | Go to post

    Leave a comment:


  • ajc308
    replied to XSL to XML &lt; to < problem
    in XML
    This is my XSL:

    Code:
     <xsl:template match="root">
      &amp;lt;root name="PlanRepository"&amp;gt;
      <xsl:apply-templates />
      &amp;lt;/root&amp;gt;
    </xsl:template>
    
    <xsl:template match="directory">
      &amp;lt;directory name="<xsl:value-of select="@name"/>"&amp;gt;
      <xsl:choose>
    ...
    See more | Go to post

    Leave a comment:


  • ajc308
    replied to XSL Sort Problem
    in XML
    I used method #1 and it worked. Thanks so much for your hep and speedy response!
    See more | Go to post

    Leave a comment:


  • ajc308
    replied to XSL to XML &lt; to < problem
    in XML
    It gives me an error because its expects the "<" to start an xsl or html element, much like using a " in some languages expects a string to be started. In other languages, there is usually an escape character, such as a /or \, but I can't seem to find anything that works in XSL.
    See more | Go to post

    Leave a comment:


  • ajc308
    started a topic XSL Sort Problem
    in XML

    XSL Sort Problem

    I have an XML document that looks like the following:

    Code:
    <root name="PlanRepository">
      <directory name="connoraj">
        <directory name="single_run1">
          <file>insidebox.txt</file>
          <file>outsidebox.txt</file>
          <directory name="SAFE_Input">
            <file>leapseconds.txt</file>
    ...
    See more | Go to post

  • ajc308
    started a topic XSL to XML &lt; to < problem
    in XML

    XSL to XML &lt; to < problem

    I am using C# to transform an XML document which actually outputs another XML document using XslCompiledTran sform and an XmlTextWriter.

    The code I am using is:

    Code:
    XslCompiledTransform myXslTrans = new XslCompiledTransform();
    myXslTrans.Load("sortByExtension.xsl");
    XmlTextWriter myWriter = new XmlTextWriter("result.xml", null);
    myXslTrans.Transform(tvXML, null, myWriter);
    ...
    See more | Go to post
No activity results to display
Show More
Working...