|
Dear,
try to use
<xsl:choose>
<xsl:when test="urcriteria">
code goes here
</xsl:when>
<xsl:otherwise>
code goes here
</xsl:otherwise>
</xsl:when>
Happy Coding
Best Regards,
Haissam Abdul Malak
|
|
|
|
|
Can you please explain us, clearly, what do you intend to do?
|
|
|
|
|
thanq anyway i found the solution
|
|
|
|
|
Hi,
I'm slowly learning enough about xsd to glue my application together.
As part of a message document i have a list of params included in a <params> element
Stage 1
I wrote the schema to hold paramaters containing string types
<param name='foo'>value1</param>
<param name='bar'>value2</param>
that's all good and the schema works
I've now designed the xml for an array element which i would like to use like this:
<param name='foo2'><array dimesions='2'>.....</array></param>
i can't work out how to define the param type to include either text or my own elements. What i really want to do is to say that a param element can contain anything whether text or xml as long as it has a name attribute defined. is xs:group the right way to go? I've tried all sorts of things, I also found xs:any but Stylus Studio won't let me use it anywhere that makes sense for what i am trying to do.
Thanks in advance,
Russell
|
|
|
|
|
Dear All,
I am working with MSXML.
I cant write integer values on XML files as a tag.
Why ?
I want to write integer vaules into XML File.
Kindly Help me.
Thanks.
|
|
|
|
|
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
|
|
|
|