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
  • getting xml values in to c#.net

    csharp help data-structures xml
    2
    0 Votes
    2 Posts
    0 Views
    L
    TopXML and www.w3schools.com both contain tutorials and references for working with XML. There is also small amounts of example code in the MSDN documentation for the classes in the System.Xml namespace. led mike
  • XSD to corresponding Table Structure(Dojo Grid)

    xml java css database help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Displaying WordML from XSLT in browser

    xml question javascript sysadmin help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • XML Parse - performance

    xml c++ asp-net wcf com
    3
    0 Votes
    3 Posts
    0 Views
    M
    Hence I should use the third option provided by you. Thanks Regards, Pavas
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • MathML

    question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Maintain the order of the xml

    xml html wpf regex help
    5
    0 Votes
    5 Posts
    0 Views
    Y
    Mark J. Miller wrote: If you can't control the order of KidList and PeopleList then the result your solution will always be the order of the xml document. Maybe I didn't explain clearly, but that is what I wanted: maintain the xml order. I thought to add the "order" attribute for sorting, but had no idea how to use it. Your code is a great help and I will use it for sure. Thanks :)
  • 0 Votes
    2 Posts
    0 Views
    M
    Just add a new xsl:template element to your XSL that matches the root element. Not sure why it works this way, because I've always done it like this. But this should work for you: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" > <xsl:output method="text" indent="yes"/> <!-- add this here --> <xsl:template match="/"> <xsl:apply-templates select="/person/index/part1" /> </xsl:template> <!-- end addition --> <xsl:template match="/person/index/part1"> xsl:textname is </xsl:text> <xsl:value-of select="name"/> xsl:text.</xsl:text> </xsl:template> </xsl:stylesheet> My best guess is that you're not telling it what to do with the root "/", so it just includes everything after the match. Mark's blog: developMENTALmadness.blogspot.com Funniest variable name: lLongDong - spotted in legacy code, was used to determine how long a beep should be. - Dave Bacher
  • c# XMLNODE SelectNodes

    csharp sales
    8
    0 Votes
    8 Posts
    0 Views
    N
    Ok, XPath and XML file needs to be altered since you are using namespaces. Check the below one <?xml version="1.0" encoding="iso-8859-1"?> <CustomerSearch xmlns:ab="http://test.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://server:81/testi-schemas/dev/test.xsd"> <EventReport xmlns="http://test.com/core/events/"> <Environment> <Validation>Off</Validation> </Environment> </EventReport> <Parameters CustomerId="" AdvertisingType=" " Email="mpavas@yahoo.com"/> <Results> <Customer CustomerId="22334" Name="pavas malviya" Address1="" Address2="WASHINGTONDC" Address3="DC 20431"></Customer> </Results> </CustomerSearch> If you have the above XML file, you can get Customer node using the following XPath. XmlDocument document = new XmlDocument(); document.Load(@"c:\XMLFile1.xml"); XmlNamespaceManager namespaceManager = new XmlNamespaceManager(document.NameTable); XmlElement customerSearchElement = document.DocumentElement; XmlNode customerNode = customerSearchElement.SelectSingleNode("descendant::Results/Customer", namespaceManager); if (customerNode != null) //do your code Also check some beginer tutorial on XPath and writing XML namespaces. Hope this helps All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
  • 0 Votes
    6 Posts
    0 Views
    P
    Mike A. Fowler wrote: What does the .xml file look like? Like the XML fragment you included in your original post, minus the ENDOFXML element. Mike A. Fowler wrote: Doesn't it have to have a reference to the .xsl file? Not necessarily. You can directly link an XML document to an XSL stylesheet by including the following declaration below your XML declaration: <?xml-stylesheet type="text/xsl" href="mystylesheet.xsl"?> If the XML file is viewed in a browser like IE, the browser will perform the transformation and display the result. Mike A. Fowler wrote: Do both the .xml and the .xsl have to co-exist in the same file? No, the XML and XSL documents reside in separate files. It wouldn't make any sense for the two to be in the same file. The stylesheet would be tightly coupled to a single XML document and couldn't be applied to other documents. Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
  • xml serialization arraylist

    question xml json help
    3
    0 Votes
    3 Posts
    0 Views
    O
    im sorry that i did not write the whole xml here it has an outer tag like ...... in this tag it writes those that i wrote first i wanted to say it writes 1 more tag under Abc i want other elements
  • XML versioning

    database question xml announcement
    2
    0 Votes
    2 Posts
    0 Views
    L
    http://www.w3schools.com/schema/schema_schema.asp[^] Look at the section titled: "Referencing a Schema in an XML Document" led mike
  • Showing "&" sign in XML file

    help xml tutorial question learning
    3
    0 Votes
    3 Posts
    0 Views
    K
    Replace & with &
  • Total Noobie

    question xml help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    L
    abesimpson wrote: I feel like the South end of a horse facing North just framing my question Maybe you are. I mean when I want to learn about something new to me I don't try to do it from the perspective of my project needs. I go find a tutorial or book on the subject and read it for what it is, not try to find something in it that pertains to my current project. For tutorials on XML I recommend TopXML and www.w3schools.com web sites. For working with Excel I recommend the MSDN documentation. led mike
  • Can we lock just a single table in xml file??

    csharp xml json question
    3
    0 Votes
    3 Posts
    0 Views
    D
    No it's not possible to do this because the file system (NTFS) laks support for locking sections of files. AFAIK, there isn't a file system on this earth that supports this. It sounds like you're treating an XML file as a small database, when in fact, you need full database support. It looks like in order to implement this requirement, you're going to have to rewrite your data access layer to use a full database, such as SQL Server Express or SQL Server Mobile. A guide to posting questions on CodeProject[^] Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic      2006, 2007
  • [Message Deleted]

    2
    0 Votes
    2 Posts
    0 Views
    L
    malarpm wrote: Can any body help me on this please? Help you with what? Read these posting guidelines[^]. Pay attention to item #11. led mike
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Contains Function!!! Please Help me (XPath)

    database question xml help
    2
    0 Votes
    2 Posts
    0 Views
    L
    Masterhame wrote: how can I do?? Well you can only do what XPath supports. Also you might find that the latest XPath standards are not fully supported by many of the XPath implementations so you need to check the specific engine you are using to determine what standard it supports. led mike
  • Schema Namespaces

    xml question csharp database dotnet
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied