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
  • need to get data from xml to verify login

    2
    0 Votes
    2 Posts
    0 Views
    L
    Your error has nothing to do with XML itself. The call to DataNode.SelectSingleNode probably returns null. In fact, directly calling methods on method calls that are prone to return null is one of the worst coding habit someone can have.Here is what a good programmer would have done: userid = DataNode.SelectSingleNode("Username"); if ((userid != null) && (!String.IsNullOrEmpty(userid.InnerText)) { // Do your stuff } else { throw new NoUsernameNodeException(); } Not checking for null values before using object references is one the worst thing to do, always leading to obscure error message "Object reference not set to an object".
  • generate a result based on a XML file [modified]

    3
    0 Votes
    3 Posts
    0 Views
    A
    no one can help? :(
  • 0 Votes
    2 Posts
    0 Views
    C
    Found solution. Here's ASP.net code in case it helps anyone else: <pre> <asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1" BackColor="#333333" BorderStyle="None" GridLines="Vertical" BorderColor="#333333" BorderWidth="0px"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%#XPath("pubDate")%>' Font-Names="Verdana" Font-Size="XX-Small"></asp:Label><br /> <asp:HyperLink ID="HyperLink1" runat="server" Text='<%#XPath("title")%>' NavigateUrl='<%#XPath("link")%>' Target="_blank" Font-Names="Verdana" Font-Size="Small"></asp:HyperLink><br /> <asp:Label ID="description_label" runat="server" Text='<%#XPath("description")%>'></asp:Label><br /> <br /> </ItemTemplate> </asp:DataList> Here's the code behind: <pre> Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBound Dim ShortDescriptionLabel As Label = CType(e.Item.FindControl("description_label"), Label) If ShortDescriptionLabel.Text.Length > 200 Then ShortDescriptionLabel.Text = ShortDescriptionLabel.Text.Substring(0, 200) & "..." End If ShortDescriptionLabel.Text = ShortDescriptionLabel.Text End Sub
  • XSLT and the xml:base-uri attribute

    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • RelaxNG Attribute Override

    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Linq to Xml Programming

    csharp database linq xml announcement
    4
    0 Votes
    4 Posts
    0 Views
    G
    Your question involves LINQ usage. Thus, you should post it under the .NET Framework forum. Since it is written in Visual Basic, you could have place it there as a second choice. However, you should still only post it in one forum. "We make a living by what we get, we make a life by what we give." --Winston Churchill modified on Saturday, March 28, 2009 5:11 PM
  • Transform XML document

    xml
    4
    0 Votes
    4 Posts
    0 Views
    G
    The document element is the top most "parent" node. Also, your example code is not showing. "We make a living by what we get, we make a life by what we give." --Winston Churchill
  • Update InfoPath option button using XML

    sharepoint xml announcement workspace
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to include Word Place Holders into my xslt?

    xml wpf com security regex
    4
    0 Votes
    4 Posts
    0 Views
    L
    Tejabhiram wrote: Could u please specify as to where shud i place these tags in my XSL Document I don't know what tags you are talking about. I you attempted to post XML on this forum you failed. Read the posting instructions. If you do not know how to use XSLT there are good tutorials on www.w3schools.com
  • Include superscript and subscript in a XML.

    question xml
    2
    0 Votes
    2 Posts
    0 Views
    S
    XML is just markup, it doesn't specify how things should look. It sounds as if you might need a markup language directed towards chemical formulas. I did a search and found CML - Chemical Markup Language: http://www.ch.ic.ac.uk/rzepa/cml/[^]. Maybe that's what you're looking for. Scott
  • SQL 2 XML DB

    database question csharp asp-net xml
    2
    0 Votes
    2 Posts
    0 Views
    L
    ahmedsamir wrote: I have a SQL2005 database and need to convert it to XML database to use it in a website using ASP.Net. That makes no sense. It is very likely that you don't understand the technologies you are attempting to use well enough to be using them. If that is the case you need to be reading rather than posting in internet forums.
  • Attribute centric XML file from SQL Server

    database sql-server sysadmin xml question
    2
    0 Votes
    2 Posts
    0 Views
    L
    CrimeanTurtle2008 wrote: but just does not work. You might need to provide more specific information than that. CrimeanTurtle2008 wrote: My question is, is it possible to create this XML file from a single table Of course it's possible. However if you are limited in the "how" it might not be. Based on your post it really sounds like you are trying to accomplish your goal using SQL Server XML generation tools. If you are limiting your solution to that then this is probably not a good forum since this is an XML forum not a SQL Server forum. In any case questions about generating XML are more about the tools you are using to do the generation and using the source data with those tools, than about XML as a subject.
  • Serialize object with XSLT ref

    xml csharp question announcement
    2
    0 Votes
    2 Posts
    0 Views
    I
    The serialization only class members will be serialized. Therefore, we need to use with XslCompiledTransform class. From microsoft web site: http://msdn.microsoft.com/en-us/library/system.xml.xsl.xslcompiledtransform.aspx[^] Ido
  • XML parser selection

    xml csharp debugging question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • C# Help Read XML Settings

    csharp question xml help announcement
    2
    0 Votes
    2 Posts
    0 Views
    L
    Look at some of the previous threads just below. In several I recommend a site that has good tutorials and references.
  • xml transformation

    xml help
    2
    0 Votes
    2 Posts
    0 Views
    L
    sonukadole wrote: ANy help on this is appriciated. Try asking an actual question. Be specific and provide information that we might need to help you. We are not with you so we can't see and know what you are doing and working with unless you tell us.
  • Validating only part of XML

    xml
    4
    0 Votes
    4 Posts
    0 Views
    L
    Hello again. If you don't respond to people posting replies to your questions, you won't often receive help from people on this site. You are asking yet another question and we still don't know any information about your development and runtime platforms and which XML library you are using. Shall we try this again?
  • Select current value in for-each statement

    question xml tutorial
    2
    0 Votes
    2 Posts
    0 Views
    D
    I solve my problem; I write this code top of the page and under <xsl:stylesheet xm...> tag; <xsl:key name="unique-orders" match="Order/Shopping/ID" use="." /> First for-each statement <xsl:for-each select="Order/Shopping/ID[generate-id() = generate-id(key('unique-orders', .))]"> Second for-each statement <xsl:for-each select="/Order/Product[ProductID = current()]">
  • XML document transformation code for Mozilla, Safari, etc...

    xml regex help
    2
    0 Votes
    2 Posts
    0 Views
    L
    rustyamigo wrote: Mozilla Firefox 3.0. Could you please let me know the equivalent code for transformation of XML document. Sure, see if this[^] helps Good luck
  • Different color within the same node

    xml tutorial question announcement
    2
    0 Votes
    2 Posts
    0 Views
    J
    Ok... I found the answer to my own question(below), but can I achieve the same result some other way, so I don't have to create nodes for it? It is very time consuming to edit the text in that manner... Thanks again! ________________________________ <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="r"> <font color="red">xsl:apply-templates/</font> </xsl:template> <xsl:template match="g"> <font color="green">xsl:apply-templates/</font> </xsl:template> </xsl:stylesheet> ____________________________________