|
The reality of the matter is that XML only knows about strings. What you need to do is convert the integer into a string representations.
|
|
|
|
|
Sakthiu wrote: I am working with MSXML
What does that mean? Working with it how? Are you writing javscripts, or what?
Sakthiu wrote: I cant write integer values on XML files as a tag.
Why would you want to do that?
led mike
|
|
|
|
|
Please illustrate what you are trying to! You are not being very clear. What language are you using? Are you trying to create and modify a XML document? Come on, now! We cannot help you if you don't give us enough information about your problem.
|
|
|
|
|
George L. Jackson wrote: You are not being very clear. What language are you using?
Are my posts invisible?
led mike
|
|
|
|
|
led mike wrote: Are my posts invisible?
Sorry, I didn't overlook your post! I just got a little too excited!
|
|
|
|
|
i need to return a complete node from one funcion to the other how can i do it?? cuz its not allowing to return a xmlnode list neither as an object
bia
|
|
|
|
|
What language are you using? If you are using C++, what library are you using?
|
|
|
|
|
|
Could you post as sample of the xml you are parsing and a snippit of the code you are having trouble with? I need this info to give you a more specific answer.
|
|
|
|
|
If you are trying to serialize an XmlNodelist or an XmlNode, I believe you cannot do this. You must create your own Serializable Object to hole your node data and store it in a serializable collection. Then you can pass the collection to or from your web service.
|
|
|
|
|
yeh i got the ans. i was trying to serialize Xmlnodelist but this cant b done cuz dsnt hav thatAdd method or somthin
thanks
|
|
|
|
|
i m calling a web method through ma client which returns a xmlnodelist but it is not working and returns the following error
To be XML serializable, types which inherit from IEnumerable must have an implementation of Add(System.Object) at all levels of their inheritance hierarchy. System.Xml.XmlNodeList does not implement Add(System.Object).
i cant understand where does this error leads to???
Warm Regards
Bia
|
|
|
|
|
This is not a XML/XSL question. Try one of the .NET forums (VB.NET, C#, .NET Framework)
led mike
|
|
|
|
|
It says you CANNOT serialize a XmlNodeList!
|
|
|
|
|
Hello,
I created a XSL file to convert a XML file to another XML.
I am running this in Asp.Net but this is not working.
----- ORIGINAL XML -----
<?xml version="1.0" encoding="utf-8" ?>
<siteMap
xmlns="http://schemas.microsoft.com/ASPNet/SiteMap-File-1.0" >
<siteMapNode>
<siteMapNode
url="~/Contacts.aspx"
title="Contacts"
description="Contacts Description"
changefreq="daily"
lastmod="2006-11-01T20:25:42+01:00"
priority="0.4"
google="true" />
<siteMapNode
url="~/Message.aspx"
title="Message"
description="Message Description"
changefreq="daily"
lastmod="2006-11-01T20:25:42+01:00"
priority="0.2"
google="false" />
</siteMapNode>
</siteMap>
----- What XML result should be (Domain Parameter =
"http://www.domain.com") -----
<?xml version="1.0" encoding="UTF-8"?>
< urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
< url>
< loc>http://www.mydomain.com/Contacts.aspx</loc>
< changefreq>daily</changefreq>
< lastmod>2006-11-01T20:25:42+01:00</lastmod>
< priority>0.4</priority>
</url>
</urlset>
----- XSL -----
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:dk="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
<xsl:param name="Domain"/>
<xsl:template match="dk:*"/>
<xsl:template match="@*|text()|comment()"/>
<xsl:template match="/">
<xsl:element name="urlset">
<xsl:apply-templates select="//dk:siteMapNode[@google='true']"/>
</xsl:element>
</xsl:template>
<xsl:template match="dk:siteMapNode">
<xsl:element name="url">
<xsl:element name="loc">
<xsl:value-of select="$Domain" />
<xsl:value-of select="substring(@url, 3)"/>
</xsl:element>
<xsl:element name="lastmod">
<xsl:value-of select="@lastmod"/>
</xsl:element>
<xsl:element name="changefreq">
<xsl:value-of select="@changefreq"/>
</xsl:element>
<xsl:element name="priority">
<xsl:value-of select="@priority"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Could someone, please, tell me why is this not working?
And is there a software or web site where I can test a XSL conversion?
Thanks,
Miguel
|
|
|
|
|
Your schemas did not match:
Original XML: xmlns="http://schemas.microsoft.com/ASPNet/SiteMap-File-1.0"
XSLT: xmlns:dk="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
Notice ASPNet <> AspNet!
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:dk="http://schemas.microsoft.com/ASPNet/SiteMap-File-1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:param name="Domain" select="'http://www.mydomain.com/'"/>
<xsl:template match="/dk:siteMap">
<xsl:element name="urlset">
<xsl:apply-templates select="dk:siteMapNode/dk:siteMapNode[@google='true']"/>
</xsl:element>
</xsl:template>
<xsl:template match="dk:siteMapNode">
<xsl:element name="url">
<xsl:element name="loc">
<xsl:value-of select="$Domain" />
<xsl:value-of select="substring(@url, 3)"/>
</xsl:element>
<xsl:element name="lastmod">
<xsl:value-of select="@lastmod"/>
</xsl:element>
<xsl:element name="changefreq">
<xsl:value-of select="@changefreq"/>
</xsl:element>
<xsl:element name="priority">
<xsl:value-of select="@priority"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
|
|
|
|
|
ok, so correct me if wrong, but a properly formatted XML file does not care about the order of its elements, correct?
<element1-name>John</element1-name><br />
<element2-country>US</element2-country>
would be parsed the same if it were listed as
<element2-country>US</element2-country><br />
<element1-name>John</element1-name>
This 2nd question regarding schema. If I had a .XSD schema file that I wanted to reference, is the following "header" in my .XML file correct?
<br />
<?xml version="1.0" encoding="UTF-8" ?><br />
<br />
< PointOfContact xmlns:xsd="http://www.w3.org/2001/XMLSchema" <br />
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:noNamespaceSchemaLocation="PointOfContact.xsd"><br />
How do I make the location "relative" (with the dot dots..)?
Thanks!
|
|
|
|
|
http://www.w3schools.com/
They've got alot of XML tutorials. Go through them
ASBESTOS-Greetings
LiquidE
|
|
|
|
|
Hi i have the following code in my xml...
<LogoPath>C:\Reports\GR_Logo.jpg</LogoPath>
How do i call this in the <img src=????/>
Thank you in advance.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
You can take value of LogoPath tag in a xsl:variable and then assign that varible to src attribute of img tag like
|
|
|
|
|
Thanks, that worked like a charm. but i didn't use it exactly like you did. I only said... <img src="{LogoPath}"/>
This used the tag caled LogoPath.
Would you by any chance know how to embed this image into the html? Say i send this html that gets generated to someone else, and that person doesn't have the image in the path specified...
Thank you for your time.
Nico
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
You can use XSLT to create HTML page of your XML data
and image should be there..means path you have specified...same like in HTML we have imgae in the source location... hope i have replied answer of your question correctly
|
|
|
|
|
Yes thank you, i understand what you mean. I can display the picture, but if i want to send the html (that was generated by the xml and xsl) i need to send the image along with it otherwise it won't display. How do i embed an image so that the image is part of the html in the end?
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
I have a XSchema document and an instance document. Validation of the instance document against the Schema works fine.
My problem is that I'm unable to select nodes from the xml-document. Namespace delarations are shown below.
For instance
XmlNodeList nodeList = xmlDoc.DocumentElement.Select("//Command")
returns 0 nodes.
Xml header:
<?xml version="1.0" ?>
<Commands xmlns="http://nn.taurus.dk/NN"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://nn.taurus.dk/NN">
... rest of xml-document
Schema header:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://nn.taurus.dk/NN"
targetNamespace="http://nn.taurus.dk/NN"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
... rest of XSchema-document
Can anybody tell me what is wrong with either namespace declarations or my select-statement ?
If I remove most of the namespace stuff and only that, the statement
XmlNodeList nodeList = xmlDoc.DocumentElement.Select("//Command")
returns the expected result.
Headers from the files where the Select statement works, are shown below.
Xml header
<?xml version="1.0" ?>
<Commands xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Customer.xsd">
Schema header:
<?xml version="1.0" encoding="utf-8"?>
< xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
|
|
|
|
I think the problem is that the Command elements are inside the "http://nn.taurus.dk/NN" namespace (declared as default on the Commands element) but this doesn't reflect in the XPath expression.
Try using an Select overload which takes a XmlNamespaceManager . Pass an instance with registered pair "someprefixname" and "http://nn.taurus.dk/NN" and change the XPAth expression to "//someprefixname:Commands".
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|