|
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
|
|
|
|
|
Member 3784412 wrote: while sending Xml file over geeting the error
That does not mean anything in english. Perhaps you need help with translation when writing your post.
|
|
|
|
|
hi i have to create an xml file and in that file the number of child elements vary during the run time that is i have to insert different options and my xml file should looklike this
<options>
<option>
<optionid>1<\optionid>
<flag> true<\flag>
<optionname>....<\optionname>
<option>
<option>
<optionid>2<\optionid>
<flag> false<\flag>
<optionname>....<\optionname>
.
.
.
<options>
the options will be given by me from the ui during the run time so i can give as many options as i can so the number of options are varying in this case how can i create the xmldocument for this </options></optionname></flag></optionid></option></option></optionname></flag></optionid></option></options>
|
|
|
|
|
pavan ravipati wrote: how can i create the xmldocument
Define more specifically what you mean by "the xmldocument".
|
|
|
|
|
I have an XML file:
<root>
<foo>
<!--Content Here-->
</foo>
</root>
Now I want generate an HTML file from it. The HTML has two vertical frames. The left one displays the treeview of the XML file. And I want the right one display content of the tree view: when I click on the "foo" node, the content will be displayed on the right.
Now I have written an XSL file to get a treeview:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<head>
<!-- Some JS code to deal with the "expand", "collapse"... sth like these-->
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a onclick="toggle(this)"><img src="plus.gif" /><img src="folder.gif" />root</a>
<div style="display:none;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="15"></td>
<td>
<a><img src="page.gif" />Foo</a>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
An HTML file which has:
<html>
<head>
<script language="javascript">
function populateFrames(){
var x = new ActiveXObject("Microsoft.XMLDOM");
var s = new ActiveXObject("Microsoft.XMLDOM");
x.async = false
s.async = false
x.load("source.xml");
s.load("tree.xsl");
var html = x.transformNode(s);
var destination = document.frames("header").document.open("text/html","replace");
destination.write(html);
}
</script>
</head>
<frameset onload="populateFrames()" cols="25%,*">
<frame name="header" scrolling="auto" target="main" />
<frame name="main" />
</frameset>
</html>
As you can see, the tree will display in the "header" frame, and I want the content in the "main" frame.
Could anyone tell me how to do this? It's very urgent: I'm waiting on line. Thanks very much for your help.
modified on Wednesday, March 11, 2009 1:03 PM
<div class="ForumMod">modified on Wednesday, March 11, 2009 1:06 PM</div>
|
|
|
|