|
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
|
|
|
|
|
hi,
I am new in ASP.NET , i heard about "diffgram" i have very small information about diffgram(used to get data from the DataSet).
Is anybody tell me some more detail about diffgram and their effective use with small example(if possible).
Thanks,
honey.
|
|
|
|
|
A DiffGram is an XML format that is used to identify current and original versions of data elements. The DataSet uses the DiffGram format to load and persist its contents, and to serialize its contents for transport across a network connection. When a DataSet is written as a DiffGram, it populates the DiffGram with all the necessary information to accurately recreate the contents, though not the schema, of the DataSet, including column values from both the Original and Current row versions, row error information, and row order.
Reference Link: http://www.techinterviews.com/?p=78[^]
|
|
|
|
|
Hi all,
what is the code snippet for getting the image path on the xml to be able to display it on the html but it needs to be embedded into the html file.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi i have xml file stored in the database and I want to deserialize the xml file from database and want to retrieve the all nodes and child nodes of the xml file stored in database. can anybody help me please
Be +ive
|
|
|
|
|
In case the XML file is stored as plain text in the database, you could just query it and create a DOM representation using XmlDocument.LoadXml method.
"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
|
|
|
|
|
|
Please tell me about following?
What is difference between Declaration Element or Processing Instruction.
Is Declaration Element is necessary for XML file. It should be first element.
Which one is root element in an XML file.
How many times a Processing Instruction can be in an XML file.
What is meant by "Content" in an XML file.
Thanks.
|
|
|
|
|
|
Hi,
i have one XML file, now i need to insert one perticular node in that through .cs page.
How can we achieve this using DOM
Regards
Dayakar D.N
|
|
|
|
|
dayakar_dn wrote: How can we achieve this using DOM
Use the DOM. Take a look around for examples and tutorials. This site (CodeProject) has Articles. There are many others as well for example on msdn.microsoft.com Google is a helpful search tool for finding articles and examples on just about any aspect of software development.
led mike
|
|
|
|
|
Here is your answer in some example code in C++/CLI with an important message for you in the inserted <body> element.
using namespace System;
using namespace System::Xml;
int main(array<System::String ^> ^args)
{
String ^xml =
L"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
L"<note>"
L"<to>dayakar_dn</to>"
L"<from>George L. Jackson</from>"
L"<heading>Reminder</heading>"
L"</note>";
XmlDocument ^doc = gcnew XmlDocument;
doc->LoadXml(xml);
XmlText ^text = doc->CreateTextNode(
L"Please, search with Google first to find your answers.");
XmlElement ^element = doc->CreateElement(L"body");
element->AppendChild(text);
doc->DocumentElement->AppendChild(element);
Console::WriteLine(doc->OuterXml);
return 0;
}
|
|
|
|
|
I'm a current MCAD student. Hope someone can help me with a small query. I am working on an application that saves student records to an xml file. Through using an Xml Schema, a dataset, a new student row and the WriteXml method, I can save a new record to an xml file.
However, if I display an existing record to a series of textboxes and want to amend the record, how do I save the amended record back to the xml file. If I find a student row using the Student ID, populate the textboxes with the details, then use WriteXml method again, that saves a new record to the file instead of amending the existing records. I therefore conclude this is the wrong way of doing things so I am asking for some help.
|
|
|
|
|
gowland0379 wrote: then use WriteXml method again, that saves a new record to the file instead of amending the existing records.
gowland0379 wrote: a dataset
So you are using the .Net framework DataSet? If so you are not handling the DataSet properly that results in a "new" row rather than updating the existing row.
Also in the future you should post .NET questions "the" appropriate .NET forums here on CodeProject (C#, VB.NET, .NET Framework, ASP.NET, ADO.NET )
led mike
|
|
|
|
|
Does any of you guys know an existing webservice, that takes an ISIN code and delivers the name of the paper?
"God doesn't play dice" - Albert Einstein
"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
|
|
|
|
|
hello
how can I create an API from my remraks in the code
in visual studio 2005?
|
|
|
|
|
Please don't cross-post.
"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
|
|
|
|
|
Hi,
I want to use javascript for adding and deleting data from an existing XML file. I want to use XML as data file for a small javascript based application. I can load the xml file and show data in the application but I am not sure how to go about in adding and deleting data from it's XML elements.
Is there any link or sample code which can help me.
Thank you,
|
|
|
|
|
|
Hello All,
My situation is this. At the company i work, we have a portal and we want add a kind of file Management system to the portal, so that the users can upload files to our repository. The current way that we have is that all documents related to every single client resides in its own directory. This files need to be categorized according to a series of parameters. So I've come to a conclusion of identifying the documents through labels or adjectives (as in GMAIL), put a label for every parameter that we want to identify the file.
My best conclusion is to use XML inside every directory, have a element tab for every doc and just add element labels under every doc. Neat idea right!
Great my problem is now I've never worked with XML before, so would like someone that reads this, point me in the right direction in what do i have to study to accomplish this.
Thanks for your time.
|
|
|
|
|
I guess with google or the search engine of your choice you should find plenty tutorials on XML (and .NET).
Furthermore you should take a look at the documentation of the System.Xml namespace and the contained classes which presents various examples and links for further reading.
"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
|
|
|
|
|
I'd use http://www.w3schools.com/ for learning things like xsd / xpath and as a reference when you forget stuff or know what you want to do but just need a little help doing it.
if you are using .Net, create yourself a xmldocument call doc.loadXML("<rootnode>") and have a play. If you are using vb6 reference msxml(N).dll where (N) is whatever version we are at now and create a DOMDocument40 object
you'll find you need to do CreateElement / CreateAttribute and AppendChild to add new nodes to the basic document.
SelectNodes / SelectSingleNode will find you bits of the tree and that's where the xpath tutorials on w3school will help.
HTH
Russ
PS feel free to ask specific questions later as the need arrises.
|
|
|
|
|
my XML doc does something like this:
< list>
< listitem>
< para>some text< /para>
< block>some text< /block>
< content>some text< /content>
< list>
< listitem>
< para>some text< /para>
< /listitem>
< /list>
< /listitem>
< /list>
that is, lists contain listitems, which can contain para, block, content, and/or other lists.
i'm trying to xform that into a simple UL/LI tree, where each list starts a new UL block and each PARA, BLOCK or CONTENT is a LI within (without changing their relative order or parenting). basically, i'm making a simple HTML preview of the XML doc.
this is my original code, a little recursive template thing:
< xsl:template name="list">
< xsl:for-each select="list">
< xsl:call-template name="listitem" />
< /xsl:for-each>
< /xsl:template>
< xsl:template name="listitem">
< ul class="xsl_list">
< xsl:for-each select="para">
< li class="xsl_list_item">
< xsl:value-of select="para"/>
< xsl:call-template name="list" />
< /li>
< /xsl:for-each>
< xsl:call-template name="list" />
< /ul>
< /xsl:template>
this worked fine for that purpose, but it only pulls out PARA text. now i need to pull out the BLOCK and CONTENT tags, too (in the right order, correctly nested, etc).
so, is there a way to do a boolean match on the < xsl:for-each select="para"> , so i could select on PARA or BLOCK or CONTENT ? if not, what's the trick to doing this?
|
|
|
|
|
Yep, just use the | operator: <xsl:for-each select="para|block|content">
Logifusion[^] "This isn't a business. I've always thought of it as a source of cheap labor. Like a family."
|
|
|
|
|
ahh, great. thanks.
another question... is there a way to tell which type was matched ? i need to do this because BLOCKs need to be handled slightly differently than PARA, so i want to be able to execute different xsl:call-template's for each type.
nevermind: looks like xsl:when test="self::nodename" is what i needed.
-- modified at 15:18 Thursday 9th November, 2006
|
|
|
|