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
  • 0 Votes
    3 Posts
    0 Views
    A
    Hi This probably doesn´t help but when I used lstElement->Item(0)->NamespaceURI in creating an xmlElemnt XmlElement *NameElement = doc->CreateElement("Name",lstElement->Item(0)->NamespaceURI); given that doc is an XMLDocument and lstElement is of type XmlNodelist. I got it to work. But again, I assume that there are two different problems. I added elements to an existing XMLDocument. Regards Daniel
  • Reading XML file with VB.Net

    csharp xml help tutorial
    6
    0 Votes
    6 Posts
    0 Views
    A
    Now I´m lost, I´ve found an example from MS Imports System Imports System.IO Imports System.Xml public class Sample public shared sub Main() Dim doc as XmlDocument = new XmlDocument() doc.LoadXml("" & _ "1-861001-57-5" & _ "Pride And Prejudice" & _ "") 'Display information on the ISBN element. Dim elem as XmlElement elem = CType(doc.DocumentElement.ChildNodes.Item(0),XmlElement) Console.Write("{0} = {1}", elem.Name, elem.InnerText) Console.WriteLine(" namespaceURI=" + elem.NamespaceURI) end sub end class You can try that one. XmlElement.Name gives the name of the node. :confused: // Daniel
  • Slashdot RSS Stylesheet

    question announcement
    3
    0 Votes
    3 Posts
    0 Views
    S
    Yeah I have that... I just need a stylesheet to display it properly, and not just a bunch of text. Thanks anyway;) // Steve McLenithan Family Guy: Season 2 - Episode 8
  • XML as a config file

    database xml question
    5
    0 Votes
    5 Posts
    0 Views
    N
    Glad to help. :) -Nick Parker
  • Using SAX to generate DOM documents

    html regex xml
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Generic XSL for table with column names

    database xml help tutorial
    3
    0 Votes
    3 Posts
    0 Views
    J
    Thanks, that's working now!:-D
  • Format XML for web page

    com xml question announcement
    3
    0 Votes
    3 Posts
    0 Views
    Z
    Something like this? http://www.informatik.hu-berlin.de/~obecker/XSLT/#xmlverbatim[^] - Mike
  • XML-serializer with ABSTRACT class

    help xml json question
    2
    0 Votes
    2 Posts
    0 Views
    H
    As the documentation states, serializable classes must have a publicly accessible default constructor because they are instantiated. Abstract classes cannot be instantiated, however. That is the problem. The solution is easy: don't hardcode the type (using typeof in your example) in your serializable code. For one, one of the benefits (one could say, the "point") of using abstract classes is that you can use a generic to refer to multiple types without caring about the specific Type of the object. Instead, use o.GetType(). Remember that in OO, even though a variable might be declared as Test or Object (pulling examples from your code), they will still be instances of myObject or Test2. So, using o.GetType() will still return the Type for myObject (even if it were declared as an Object). If you use that in the constructor for the XmlSerializer, you shouldn't have any problems. This way, also, you don't hardcode that the serializer only accepts myObject. You will want to, however, use a condition or something before serializing to make sure that the object to be serialized is a Test derivative: public void SaveTest(Test t) { // In this case, the CLR verifies that the object is of type Test // (or a derivative) because the parameter above is a Test type. XmlSerializer serializer = new XmlSerializer(t.GetType()); StreamWriter writer = new StreamWriter("test.xml"); serializer.Serialize(writer, t); } public void Save(object o) { // In this case, we should check to make sure that the object is // a Test type. For brevity, well check and pass to SaveTest. if (o is Test) SaveTest(o as Test); } -----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-----
  • Pass a xml doc to a web service?

    csharp question visual-studio com xml
    6
    0 Votes
    6 Posts
    0 Views
    J
    Thanks, Jason W.
  • Passing XmlResolver to Transform() method

    xml html sysadmin help question
    3
    0 Votes
    3 Posts
    0 Views
    K
    Thank you Nick! I did need to use an XPathNavigator but even then the error message about using XmlResolver still appeared. Upon further research I found that XmlResolver is a argument in the Transform method. Transform(XPathNavigator, XsltArgumentList, TextWriter, XmlResolver); I had left this argument out and that is what generated the error. I still have no clue as to when or why to use a XmlResolver but found when I inserted a null for the arguemnt as it appears in your code that the error disappeared. Transform(nav,null,writer,null); I suspect you can create custom resolvers to influence the Transform but that's for another day. Problem solved. Thank you. Kyle
  • Stripping null characters from XML elements

    xml hardware regex question
    2
    0 Votes
    2 Posts
    0 Views
    C
    I solved the problem, which had nothing to do with the XPath queries. My XSL stylesheet is a Content file in a VS.NET project. I forgot that VS DOESN'T copy content files to the output folder. Thus, all of my stylesheet edits were never used! This is what I ultimately used to remove the nulls: translate(/myEl, '�', '') Does anyone know why VS doesn't copy content files to output folder?
  • Pagination of XSL report

    xml html wpf com json
    2
    0 Votes
    2 Posts
    0 Views
    P
    you need to use CDATA to stop xslt trying to parse the print templates.. "When the only tool you have is a hammer, a sore thumb you will have."
  • XSL - grab unprocessed nodes

    xml
    5
    0 Votes
    5 Posts
    0 Views
    C
    Hi Paul. What sort of resistance ? Why would people not want to use it ? Yes, in the end I wrote rules that specified the nodes I wanted and a rule that specified all other nodes, by listing the ones I wanted and put not in front of it. I was hoping for a sexier solution, but it eluded me. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
  • Perl lite?

    csharp perl com question
    2
    0 Votes
    2 Posts
    0 Views
    N
    Jason Weibel wrote: non Microsoft users? They exist? Ok, just joking. ;P I assume you are talking about this[^]? If so, it looks like it supports both the SOAP 1.1 and 1.2 specs so you should be ok. Have you tried to create a quick example using it, there are plenty of examples listed. -Nick Parker
  • directory changing

    help com tools xml tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • XML error

    xml help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • "Good" XML/XSL(T) books...?

    csharp xml asp-net question learning
    3
    0 Votes
    3 Posts
    0 Views
    M
    I second that! Excellent book. Author is David Hunter. ~Mike Stanbrook
  • XML -> Dataset + ComboBox?

    wpf wcf xml question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • XML Web Services and SOAP

    wcf xml learning
    2
    0 Votes
    2 Posts
    0 Views
    J
    I have ‘Real World XML Web Services By Yasser Shohoud’ and have gotten a lot out of it. This book is aimed at VB and VB.Net programmer if you don’t fall into that category I would try something else. My one complaint about the book is the examples do not get complex enough. There are some sample chapters and articles by Yasser at http://www.learnxmlws.com/learn/tutors.aspx. A second book I have is ‘Applied XML Programming for Microsoft .NET by Dino Esposito‘ it is a very good in-depth book about XML programming, it doesn’t touch web services as deeply as Yasser’s book but it has a lot of good stuff in it. All the code in the book is written in C#. In learning how to program web services I still have had question that I wasn’t able to answer with the books but I think you will have that with ever thing. Both these books are aimed at .net web services so keep that in mind when considering them. Note, just because I think these are good books doesn’t mean you will agree. I say that because Yasser’s book had several good reviews on amazon and one horrible one. Basically it comes down to were the books worth the $30 I paid for each of them, yes. Jason W.
  • XML - Stylesheets - for removing schema info

    xml html database help question
    2
    0 Votes
    2 Posts
    0 Views
    P
    <xsl:stylesheet exclude-result-prefixes="dt rs z" "When the only tool you have is a hammer, a sore thumb you will have."