all groups > dotnet xml > june 2005 > threads for june 1 - 7, 2005
Filter by week: 1 2 3 4 5
XmlTextReader Question
Posted by Raed Sawalha at 6/7/2005 11:14:03 PM
I have the following XML
i do the following to extract the name information
XmlTextReader Reader = new XmlTextReader("C:\\names.xml");
while(tempReader.Read() )
{
if(tempReader.Name.ToLower() == "name ")
{
//My problem here how to get firstname and last for the... more >>
XML Schema Question Number 1
Posted by ToChina at 6/7/2005 7:23:50 PM
Is it possible to write a restriction on a simple type which states that the
number of sub-elements of an element must be the same as its attribute
value?
Hmm, perhaps this example would make sense:
<friends number="4">
<friend name="Fred"/>
<friend name="Bert"/>
<friend name="... more >>
XmlDocument.SelectSingleNode() & namespaces - doesn't work
Posted by David Thielen at 6/7/2005 3:20:03 PM
Hi;
If there are no namespaces this works fine for me. But if the xml has
namespaces, then I get either no node back or an exception.
Here is the sample xml:
<root xmlns="http://www.test.org"
xmlns:sns="http://www.test.org/sub"
xmlns:mns="http://www.test.... more >>
Track the difference of 2 xml files by code
Posted by cliff at 6/7/2005 1:26:03 PM
Folks:
I am trying to find a best solution of the task of tracking the changes of a
xml file.
The scenrio is like this: we have a original copy of xml data. Clients
submit a new copy of xml data with changes (like new nodes or change text
values etc). What is the best approch to get a c... more >>
XML adding a node in C#
Posted by Keith M at 6/7/2005 9:40:24 AM
Hi,
I have found a very useful piece of code in the msdn which shows how to load
an xml config file, search for a particular value and replace it.
Could someone possibly convert it to C# from the VB I have?
I also would like to use similar code to update the machine.config file so
if someone ... more >>
Validation Problem
Posted by Harry_Crow at 6/7/2005 2:03:01 AM
I have a schema file PDDSch.xsd which validates the PDD.xml file. the
rootnodes are as shown below
PDD.xml
<PDD xmlns="http://tempuri.org/PDDSch.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-Instance" >
PDDSch.xsd
<xs:schema id="PDD"
targetNamespace="http://tempuri.org/PDDSch.xsd"... more >>
ERR: The root element is missing
Posted by Paul Nations at 6/6/2005 4:27:28 PM
I'm in a real pickle. I've inherited a project with major problems. It
receives encrypted XML files from a website not under my control (so I can't
modify the web app) for insertion into a database. I'm under intense
pressure to get the data into the database NOW. I can decrypt the files
... more >>
saving file from asp.net
Posted by helpful sql at 6/6/2005 11:10:23 AM
Hi all,
I dynamically generate Word Documents from my web application using
XmlDocument object and need to save them on a mapped network drive. I use
the Save method of XmlDocument object to save documents. Ican save them
successfully on local drive on web server. But when I try to save th... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Remove a nodes where attribute has specified text. (Variable depth xml)
Posted by Mikey at 6/6/2005 10:04:44 AM
I have an XML document as follows:
<Menu>
<Group>
<Item Text="About Us" AccessRoles="All">
<Group>
<Item Text="Option 1" AccessRoles="All" />
<Item Text="Option 2" AccessRoles="All" />
<Item Text="Option 3" AccessRoles="All" />
</Group>
</Item... more >>
Dealing with a null Namepsace in xmlDocument
Posted by Keith Chadwick at 6/6/2005 7:38:01 AM
When I submit my xmldocument to my web server it is adding in a namespace
with no namespace to the root which is preventing me from using an xpath on
the document. The xml submitted via soap to the web service looks like this:
<root xmlns="facts">
<mydata>.....</mydata>
</root>
I have u... more >>
XML ID attribute & GetElementById
Posted by Patrick at 6/6/2005 3:24:01 AM
>Is it actually valid to have an XML document with 2 XML Elements having the
same ID attribute? XML Spy seems to allow something like the following
<?xml version="1.0" encoding="UTF-8"?>
<FormDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="F... more >>
Find the depth of XML
Posted by Raed Sawalha at 6/5/2005 7:49:04 AM
I have following XML:
How can I find the depth of XML?
in other word max level of the XML
<Root> ----- level 0
<Name>----- level 1
<FirstName>name</FirstName> ---- level 2
<LasName>lname</LastName>
<MiddleName>mName<MiddleName>
</Name>
<Information>
<Info1>
... more >>
My windows giveth xml and it taketh away! Include path!
Posted by Garry Freemyer at 6/4/2005 11:32:36 AM
I wrote a screensaver, via Visual Studio 2003 in C# and I decided a wiser
choice for me was to use an xml file to save my configs. Btw: I wonder if
this is why every bit of documentation I've found for saving configuration
info in an xml file speak of only doing this for web programming in fac... more >>
Serialize XML With Attributes Instead of Elements
Posted by grwalker NO[at]SPAM vt.edu at 6/4/2005 9:23:26 AM
I have some classes that have the <Serializable()> attribute applied,
which of course by default serializes the class properties as elements.
What I would like to do is to be able to override this behavior at
runtime to serialize the properties as attributes.
I have been exploring the XMLAttri... more >>
Converting C# object to XmlElement object.
Posted by James X. Li at 6/4/2005 12:04:57 AM
Hi everyone,
the class XmlSerializer provides a generic way to convert a
C# object to a XML file. Does anybody know a similar way
to convert a C# object to a XmlDocument or XmlElement object
without writing the content to an external file?
I am using a XML DOM tree as a sort of in-memory "d... more >>
<?mso-application progid="Word.Document"?>
Posted by Petar Popara at 6/3/2005 2:32:57 PM
I did everything as Kevin Yu explained here:
http://tinyurl.com/9tw6c
but it doesn't work. :(
I'm using WinXP Pro SP2 and latest IE. I don't have Office 2003 installed.
What should I do?
... more >>
Merging two XML Files
Posted by Nikhil Prashar at 6/3/2005 1:51:01 PM
I'm trying to merge two XML files that have the same structure but not
necessarily the same nodes in the same order. I've tried opening the files as
datasets and using the DataSet.Merge() function, but this only "fumbles" the
data together and puts children under the wrong parent nodes. How el... more >>
URGENT - how to Specify a Colon in the attribute
Posted by chrispragash NO[at]SPAM hotmail.com at 6/3/2005 9:24:30 AM
Hello Everybody,
Is there a way that I can specify a ":" using
System.Xml.Serialization.XmlElementAttribute? If I type in
System.Xml.Serialization.XmlElementAttribute("X:Y"), the output xml
renders as X_003A_Y - Any suggestions/ideas would be really helpful.
Regards,
Chris
... more >>
importing schema
Posted by farseer at 6/2/2005 1:21:50 PM
Hello,
i have a schema which also imports the XHTML schema:
<xsd:import namespace="http://www.w3.org/1999/xhtml"
schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"/>
This schema validates fine in XMLSpy and in VS2005.
However, in Visual Studio 2005 beta2, when i attempt to... more >>
add namespaces to elements ?
Posted by (cmrchs NO[at]SPAM yahoo.com) at 6/2/2005 3:43:26 AM
Hi,
is there an easy way to provide all elements in an xml-document of a namespace-prefix.
Example of source file :
<book>
<title>Alaska</title>
</book>
convert to :
<bk:book xmlns:bk="http://localhost/mybooks">
<bk:title>Alaska</bk:title>
</bk:book>
can th... more >>
sorting sub-elements
Posted by Xavier Pacheco at 6/2/2005 12:49:49 AM
Sorting nodes/rows
given the following xml:
<top>
<someelement/>
<someotherelement/>
<item>
<sequence>5</sequence>
<subitems>
<subitem>hello5</subitem>
</subitems>
</item>
<item>
<sequence>4</sequence>
<subitems>
<subitem>hello4</subitem>
</sub... more >>
Xpath Search with Namespaces
Posted by NOSPAM.schnell NO[at]SPAM rdacorp.NOSPAM.com at 6/1/2005 10:59:54 AM
I've run into a problem trying to search an XML document with a
namespace. Sample extract is below:
<Vendors xmlns="http://tempuri.org/Vendor.xsd">
<Vendor>
<VendorID>002010</VendorID>
<PropricerId>002010S</PropricerId>
<VendorName>AEROTEK, INC.</VendorName>
</Vendor>
<Vendor>
... more >>
XSL Transform by DataType
Posted by Deck at 6/1/2005 10:13:48 AM
Hello,
I am trying to find a way to format an XML attribute using XSL. I want to
run the format based on the datatype of the attribute.
I need to remove everything from the "-" in a attribute that is defined as a
datetime. I cannot go by the actual attribute name I need to process based ... more >>
how 2 generate xml file
Posted by Blair Chen at 6/1/2005 12:00:00 AM
Pls help me out
I am trying to generate xml file via XmlDocument class. I ceated a
XmlDocument instance, how can I convert it to a physical xml file(e.g.
test.xml)?
following is the code:
//add root
XmlElement rootNode = xmlDoc.CreateElement("root");
rootNode.SetAttribute("root", r... more >>
|