|
I think you have more than one parent nodes in an xml file
i.e
<aa>..
<bb>..
it should be
<root>
|
|
|
|
|
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
|
|
|
|
|
Hi all,
I have an object called “Report” that I want to serialize.
The saved object will be open at IE browser.
I want to save object from C# code with line at the head:
<?xml-stylesheet href="Report.xslt" type="text/xsl" ?>
How I do that?
I used with XmlSerializer from microsoft.
var serializer = new XmlSerializer(typeof(Report), NameSpace);
writer = new StreamWriter(fullpath));
serializer.Serialize(writer, this);
The result is :
<?xml version="1.0" encoding="utf-8" ?>
<Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/Report.xsd">
<StartDateTimeTest>22-9-2009 12:00:12</StartDateTimeTest>
<EndDateTimeTest>22-9-2009 12:10:12</EndDateTimeTest> ......
And i want to get
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="Report.xslt" type="text/xsl" ?>
<Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/Report.xsd">
<StartDateTimeTest>22-9-2009 12:00:12</StartDateTimeTest>
<EndDateTimeTest>22-9-2009 12:10:12</EndDateTimeTest>.....
I am very desperate,
Thanks all.
Ido
|
|
|
|
|
|
Hello All,
I am attempting to create an attribute centric XML file using data from SQL Server 2008, without any luck.
My question is, is it possible to create this XML file from a single table, rather than the use of UNION between two tables, when I use the XML Explicit format.
I have tried doing the XML Explicit format with the single table, but just does not work.
My table comprises of the following
RestarauntID int
Name varchar
lat float
lng float
rank int
I wish to have it in this XML format
<rests>
<name lat="-44.008782" lng="100.104508" rank="1" />
<name lat="-21.991933" lng="200.132626" rank="2" />
</rests>
I am most thankful for the assistance.</pre>
|
|
|
|
|
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.
|
|
|
|
|
Hi,
I have a SQL2005 database and need to convert it to XML database to use it in a website using ASP.Net.
How can I do this operation?
|
|
|
|
|
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.
|
|
|
|
|
In VS2008, the XSLT debug is done using .Net parser (default). Is it possible to configure it to use MSXML4 or MSXML6 parser instead, the one that IE uses?
Regards,
ML
|
|
|
|
|
How can i read that XML Scheme using C# .NET 2.0?
XML Document:
<?xml version="1.0" encoding="utf-8"?><br />
<mirror path="C:\folder"><br />
<filter sub="1">*.mp3</filter><br />
<filter sub="1">*.wav</filter><br />
<filter sub="0">*.ogg</filter><br />
<filter sub="1">*.mp4</filter><br />
<filter sub="0">*.wmv</filter><br />
</mirror>
i tryed many ways but i cant put this working
xml can have more than 1 <mirror> element, also i need read atributes
thanks
|
|
|
|
|
Look at some of the previous threads just below. In several I recommend a site that has good tutorials and references.
|
|
|
|
|
I am transforming one xml into another in such a way that nodes are excluded (deleted) till attribute matches with value of user defined parameter .
ANy help on this is appriciated.
|
|
|
|
|
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.
|
|
|
|
|
<xsl:for-each select="Order/Shopping">
Voucher No: <xsl:value-of select="Voucher"/>
Name: <xsl:value-of select="Name"/>
<xsl:for-each select="/Order/Product[ProductID = XXXXXXXXXX]">
Product: <xsl:value-of select="ProductName"/>
</xsl:for-each>
</xsl:for-each>
I want to show Order/Shopping and /Order/Product/ which Order/Shopping/ID == /Order/Product/ProductID
XXXXXXXXXX is current Order/Shopping[ID] value.
How can I get current ID node value in for-each statement?
What is XXXXXXXXXX value in this example?
Best Regards...
|
|
|
|
|
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()]">
|
|
|
|
|
Hello everyone =]
I have xml file that contains messages I insert into MSMQ. I use XSD to validate the messages, but as expected, validation fails if any of the messages is not in the correct format, this way I lose the other valid messages.
I need to work out a way to validate only one message each time and handle it in the application level. I thought about looping through all the elements in the xml and creating a new document for each message and validating it alone, but I thought I'd ask first if you guys have any other and better solutions.
Thanks in advance =]
|
|
|
|
|
Welcome to Code Project
What XML library are you using? Other development platform information that might be needed to help you should also be supplied.
|
|
|
|
|
Ok, some progress.
I loaded the xml, used GetElementsByTagName to find the messages nodes and iterated through each node.
My problem is that GetElementsByTagName automatically adds to each node "xmlns" attribute, which makes problems later with deserialization since the automatically generated class does not contain the xmlns attribute. :S
How do I prevent it from automatically showing up in each of the nodes?
|
|
|
|
|
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?
|
|
|
|
|
Hi, can anyone help with me this as I'm relatively new with XML programming. I have code that's running perfectly in IE 7 but I'm no able to run it in other browser say Mozilla Firefox 3.0. Could you please let me know the equivalent code for transformation of XML document. I have pasted the code I have used for IE 7. Please help!!!
Home.xsl:
<xsl:template match="root/HOMEPAGE" xmlns:xsl="#unknown">
TEST
</xsl:template>
Home.xml :
<root>
<homepage>
<detail></detail>
</homepage>
</root>
Here is the code which has been used for I.E I want an equivalent code for Mozilla etc
var objXMLHome = new ActiveXObject("Msxml2.DOMDocument");
objXMLHome.async = false;
objXMLHome.resolveExternals = false;
objXMLHome.setProperty("SelectionLanguage", "XPath")
objXMLHome.load("XML/Home.xml");
var objXSLHome = new ActiveXObject("Microsoft.XMLDOM")
objXSLHome.async = false
objXSLHome.load("XSL/Home.xsl");
document.all("divHEADER").innerHTML = objXMLHome.selectSingleNode("//HOMEPAGE").transformNode(objXSLHome.documentElement);
|
|
|
|
|
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
|
|
|
|
|
I'm completelly new to XML/XSL so bare with me.
I'm trying to use different colors within the same node...
In the following example:
__________________________________________________
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<example>
<title> This is the title </title>
<text>
This is a sample text.
I want to make next word <g>GREEN<g>
I want to make this one <r>RED<r>
</text>
</example>
_____________________________________________________________
What should style.xsl be so that the word "GREEN" appears green and same with "RED" once I open it with the browser?
Is there an easier way to code the XML in order to achieve that?
Thanks!
|
|
|
|
|
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>
____________________________________
|
|
|
|
|
Can a wepapplication has more than one web.config file.I have two web.config files in my application.Now i want to make connection with the second web.config file.how can i do that.
Please answer
|
|
|
|
|
while sending Xml file over geeting the error
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Cannot have a DOCTYPE declaration outside of a prolog. Error processing resource 'http://localhost:2657/gridviewexcel1/Defa...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&...
please give the sol
|
|
|
|