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
  • schema location / nonamespaceSchema

    xml database question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • XSLT

    xml database tools help
    5
    0 Votes
    5 Posts
    0 Views
    L
    I'm using a .NET framework v1.0 so i'm restricted with which overload i can use in the transfrom method. What i do is give the Xsl a XPathNavigator that i created from the XmlDocument, i give it null for the arguments and a stream to write to: string transfrormerStyleSheet = LoadTransfrormer(); XmlDocument transformationDocument = new XmlDocument(); transformationDocument.LoadXml(_transfrormerStyleSheet_); XmlNodeReader transformationReader = new XmlNodeReader(_transformationDocument_); XmlDocument guiXmlDocument = new XmlDocument(); xmlDocument.LoadXml(_xmlAsString_); XslTransform transformer = new XslTransform(); transformer.Load(_transformationReader_); XPathNavigator xpn = xmlDocument.CreateNavigator(); FileStream fs = new FileStream(Environment.CurrentDirectory+"\\TempXMLstream.xml",FileMode.Create); StreamWriter sw = new StreamWriter(_fs,System.Text.Encoding.UTF8_); transformer.Transform(_xpn,null,sw_); sw.Flush(); sw.Close(); fs.Close(); I need the stream to be in UTF8 specificly.
  • 0 Votes
    2 Posts
    0 Views
    A
    Take a look at IHTMLDocument and IHTMLElement)interfaces. In general you'd need to get a hold of html document, then get and html elemnt that you are interseted in (using probaly one of getElement.. methods) and then change it. Edward
  • XSLT - how to preserve empty spaces?

    xml question tutorial
    5
    0 Votes
    5 Posts
    0 Views
    A
    This should work:   Edward
  • Title bar in internet browser with frames

    question html com xml
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • I'm lazy - How to do it without learning XSLT :)

    xml question html tutorial learning
    6
    0 Votes
    6 Posts
    0 Views
    M
    Thanks for telling me, I fixed the link...
  • Most efficient way to save changes made in xmlDoc?

    xml question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Dynamic Link Creation in ASP.Net Page /XSL

    xml csharp html asp-net database
    5
    0 Votes
    5 Posts
    0 Views
    M
    Params to the XSL file Check this out I just posted it [Post] You can send a param to the XSL and have it print it out as a link.
  • XSLT - Adding whitespace to a string

    xml question
    2
    0 Votes
    2 Posts
    0 Views
    P
    not easy to do in xslt - here is the "pure" way (you could just embed some c# code in the xslt) xml source document: <document>    <abc>1234</abc>    <abc>234234</abc>    <abc>21321</abc>    <abc>91243149384</abc> </document> xslt document: <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"    version="1.0">         <xsl:output method="xml"          media-type="text/xml"          indent="yes"          encoding="UTF-8"/>        <xsl:template name="document">       <xsl:apply-templates select="abc" />    </xsl:template>        <xsl:template name="abc">       <xsl:call-template name="padstring">          <xsl:with-param name="times" select="10 - string-length(text())" />          <xsl:with-param name="string"><xsl:value-of select="text()" /></xsl:with-param>       </xsl:call-template>                      </xsl:template>    <xsl:template name="padstring">       <xsl:param name="current">1</xsl:param>       <xsl:param name="times" />       <xsl:param name="string" />       <xsl:param name="paddingchar">&#32;</xsl:param>              <xsl:if test="$times &gt; 0)>          <xsl:value-of select="$paddingchar" />       </xsl:if>              <xsl:if test="not($times &lt; $current) and $current != $times">        &
  • HTTP Get-Post and XML

    question c++ com sysadmin xml
    3
    0 Votes
    3 Posts
    0 Views
    L
    This might help if you are using asp . You need to create a corresponding xsl for the xml output. Then u can use the function below in your asp page . <% 'Load the XML set xml = Server.CreateObject("Microsoft.XMLDOM") xml.async = false xml.load(Server.MapPath("Yourxmldoc.xml")) 'Load the XSL set xsl = Server.CreateObject("Microsoft.XMLDOM") xsl.async = false xsl.load(Server.MapPath("yourxsldoc.xsl")) Response.Write(xml.transformNode(xsl)) %>
  • XSLT for converting an XML document to Text file

    xml help tutorial
    2
    0 Votes
    2 Posts
    1 Views
    P
    something like this would work: <xsl:template match="Extraction">  <xsl:for-each select="BBRequest|ITLRequest">   <xsl:for-each select="*">    ^<xsl:value-of select="name()" /><xsl:value-of select="text()" />    <-- get any details in subitems such as POAddress and HomeAddress -->    <xsl:for-each select="*">     ^<xsl:value-of select="name()" /><xsl:value-of select="text()" />    </xsl:for-each>   </xsl:for-each>  </xsl:for-each> </xsl:template> the trick is to use the name() function to get the name of the node "When the only tool you have is a hammer, a sore thumb you will have."
  • JSP and Tomcat

    java html apache database com
    5
    0 Votes
    5 Posts
    0 Views
    T
    One more question, A litle less, but still importent: I have linux mandrake. and I need to install the JDK so I downloaded the file: JDK_file.rpm.bin And executed it from the using the linux command: . JDK_file.rpm.bin After the extrection... I typed: ls. and saw the list of files. 2 files were there: JDK_file.rpm.bin and **install.something.1157** How do I run the .something file?? =-=-=-=-=-=-= The-Server :rose:
  • RSS Feed not displaying properly

    help php database com question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    2 Posts
    0 Views
    P
    Set objprice = objDom.SelectSingleNode("//price/comdt[" & x & "]/Tprice") "When the only tool you have is a hammer, a sore thumb you will have."
  • XSLT of data extracted via XPath?

    xml help question csharp
    2
    0 Votes
    2 Posts
    0 Views
    A
    You can use for-each statement in xslt and loop thru in xslt. But anyway you have to pass XMLDocument, not XMLNodeList. Pass the XPath as a parameter to XSLT or you can hardcode in xslt if it doesnt change. You can check MSND for how to use for-each statement and Passing parameters to XSLT.
  • Serializing Arrays in .NET

    csharp data-structures xml json question
    5
    0 Votes
    5 Posts
    0 Views
    H
    You can search for the discussion in google, since both DevHood and CodeProject are well-indexed. I will point you to two articles that were the results of those discussions: XML Serialization of Collections in C#[^] XML Serialization in C#[^] Both of these end up in wrapping a list or array in a class to be serialized, but then that gives you control over what exactly is serialized. Otherwise, make a collection or a list class as I mentioned before, and implement IXmlSerializable, which is pretty easy to implement, though undocumented. -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
  • xml transform

    csharp asp-net database xml help
    2
    0 Votes
    2 Posts
    0 Views
    H
    Since you're using ASP.NET, just take advantage of the easy-to-use Xml web control. Give it an XML document, XSLT document, and render it (ASP.NET will do this when sending the response to a client browser). If you need this in a database, you can render it yourself and save the resulting document to a database. You could also do this manually using the System.Xml.XmlDocument and System.Xml.Xsl.XslTransform classes. They do contain example source code. -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
  • Serializing web server controls

    help sysadmin xml json
    2
    0 Votes
    2 Posts
    0 Views
    H
    Classes need default constructors (constructors with no parameters) in order to serialized using the XmlSerializer. You'd have to extend these and implement a default constructor in the class itself. -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
  • extract data from xml document

    xml help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    N
    Please be more specific, if you have a particular question with a defined scope there are many who are willing to help. - Nick Parker   My Blog
  • Problem with transformation result

    xml html help question
    3
    0 Votes
    3 Posts
    0 Views
    T
    Thank you, that worked perfectly. :-D