microsoft.public.dotnet.xml
Up to: Discussion Lists

  • RSS Syndication
  • Post a new message to this list...
    Latest Discussions Archive
    NameSpace Confusion (6 replies, VIP)
    microsoft.public.dotnet.xml
    I have attached an XML document that uses the following definition in the root element xmlns "http://www.rosettanet.org/RNIF/V02.00". When I load the attached XML into an XmlDocument object then try to perform XPath queries I get nothing back. I know it has to do with the namespace but I have not run across one like this before and I am not very good with namespaces. I take and create a namespace ...
    XmlTextReader errors with network stream after SP1 (5 replies, VIP)
    microsoft.public.dotnet.xml
    All, I have an instance of an XmlTextReader that worked perfectly fine in the Framework 1.1 prior to SP1. After upgrading to SP1, I started receiving "Root node not found" errors. The code that I am working with is open source (jabber net), and everyone that has upgraded to the SP1 is experiencing the same error. One of the members has done some research and testing with the following results: 1) ...
    XmlSerializer Collection with Collections (4 replies, VIP)
    microsoft.public.dotnet.xml
    Hello I got this working but it is not how I really want it, basically I have an xml file which has a root of test and can be filled with 3 different types of question elements with different attributes, all share a base set of 4, one of the question types can have children with option elements, this is how the xml looks after serialization.... If you notice there is an extra SelectionList around ...
    Ask for xmlelement copy method (5 replies, VIP)
    microsoft.public.dotnet.xml
    Hello everyone. I have two instance of xml.xmldocument. One is XA another is XB. XA has a child node XA1. XA1 has many attributes and child nodes. Now I want to copy XA1 to XB with all of it's attributes and child nodes. In .NET, the type of XA1 is xml.xmlelement. If I use clone method. The copy of XA1 is belong to XA. I can not append it to XB. If I careate a new instance from XB.CreateElement me...
    XML problems (5 replies, VIP)
    microsoft.public.dotnet.xml
    considering the following xml example ?xml version "1.0" encoding "ISO8859 1"? results interaction point auxf 6.812890 /auxf auxh 0.000000 /auxh /point point auxf 5.614157 /auxf auxh 0.479757 /auxh /point point auxf 4.040000 /auxf auxh 38.000000 /auxh /point /interaction interaction point auxf 6.812890 /auxf auxh 0.000000 /auxh /point point auxf 5.614157 /auxf auxh 0.479757 /auxh /point /interacti...
    System.Xml.XmlValidatingReader.set_ValidationType raised InvalidOperationException (5 replies, VIP)
    microsoft.public.dotnet.xml
    I am using an XmlValidatingReader which uses an XSD for xml validation. The code has been performing reliably for months. Yesterday it failed for the first time with the following exception: Inner exception of type System.InvalidOperationException has occurred : The operation is not valid due to the current state of the object. [source System.Xml] [method call set ValidationType] [stack trace at S...
    SelectNodes (3 replies, VIP)
    microsoft.public.dotnet.xml
    I am having a bit of a brainfart here at 4am in the morning. I have XmlNodeList TmpServers ServerNodes.SelectNodes("[server '" DataSource "']"); and I have also tried XmlNodeList TmpServers ServerNodes.SelectNodes("server '" DataSource "'"); DataSource is computername\instancename TmpServer contains children nodes of server with values that i wish to compare I know that if i were doing it from the...
    XmlValidatingReader - just the FAQS? (4 replies)
    microsoft.public.dotnet.xml
    All, I am having a tough time figuring out how to code a simple app to read an xml file and an xsd file and validate the xml file using the xsd without using a namespace for the schema. Help? Also, is there a .NET XML FAQ? Thanks, Will Here are the details: the error Validation Error: The 'HeadCount' element is not declared. An error occurred at file:///d:/xml/config.xml, (2, 2). Validation Error:...
    Error deserializing previously serialized object (3 replies)
    microsoft.public.dotnet.xml
    I've used XMLSerializer before to store user settings with great success, but this is the first time I've tried to serialize an Array. It serializes fine, but when I try to deserialize it, I get the following error: There is an error in XML document (0, 0). System.Xml.XmlException: The data at the root level is invalid. Line 1, position 1. As I've done this before, I'm at a loss to explain it. Her...
    XSD Problem when using Xpath code (3 replies)
    microsoft.public.dotnet.xml
    When I import an xml document in Visual studio and Genereate as schema from it, and create a dataset from it, it adds this line into to the root element of my xml file "xmlns "http://tempuri.org/nameOfRoot.xsd" I have no idea what its pointing to & what is tempuri.org? So when this tag is in my xml tag my xpath query never works. But when I delete it work fine. Can someone please tell me what that...
    Loop through and count occurences (3 replies)
    microsoft.public.dotnet.xml
    Does anyone know how to get all nodes in a xml document that start with a certain text? In my case I want to count all suppliers ( id Supplier* /id ) root customer name ABC /name id Supplier123 /id /customer customer name DEF /name id Dealer212 /id /customer customer name qwerty /name id Supplier111 /id /customer customer name asdf /name id Supplier4455 /id /customer /root Best regards Niklas E
    xmlns=''> was not expected. (5 replies)
    microsoft.public.dotnet.xml
    Hi guys,Does any1 know what this error is all about, what I am trying to do is deserialize a XML, below is my code, let me know what I am doing wrongpublic class test{xin " ?xml version '1.0' encoding 'UTF 8'? InSession PassWord foo /PassWord UserName foo@foo.com /UserName /InSession ";XmlSerializer serializer new XmlSerializer(typeof(cXmlBS));XmlTextReader tr new XmlTextReader(new System.IO.Strin...
    WriteXml to include xslt reference statement - how? (4 replies)
    microsoft.public.dotnet.xml
    Hi, I'm new to using xml/xslt and although I can create an xml document using the dataset.WriteXml statement, and I have created an xslt to transform the xml into the output I want, I have to manually add the xsl reference statement to the xml file. i.e. ?xml version "1.0" standalone "yes"? ?xml:stylesheet type "text/xsl" href "Questions.xsl"? I have to add this NewDataSet Questions ID 1 /ID . . ....
    Help Creating XmlNode / XmlAttribute Elegantly (3 replies, VIP)
    microsoft.public.dotnet.xml
    I am creating a configuration class to read / write a standard configuration file. ?xml version "1.0" encoding "utf 8"? configuration appSettings add key "ConnectionString" value "server (local);" / /appSettings /configuration I am using a XmlDocument for my base implementation. I am looking to see if there is a better way to add a new node / attribute than using XmlDocument.InnerXml. I would cons...
    Using innerXml and outerXml on a xmlDataDocument leaks cpu-resourc (6 replies, VIP)
    microsoft.public.dotnet.xml
    Selecting element nodes from a xmlDataDocument using the childNodes collection or by using selectSingleNode and then reading innerXml or outerXml leaks cpu resources. A trivial example showing this behaviour is included below. Running this example increases the cpu load gradually and reaches 100% within a minute or two. The problem exists with innerXml as well as outerXml operations. Using a xmlDo...
    Getting exception: Cannot have '?>' inside an XML processing (9 replies, VIP)
    microsoft.public.dotnet.xml
    I am getting an error "Cannot have '? ' inside an XML processing instruction." when I load a System.Xml.XmlDocument document from a XML file and iterate through the nodes (the error occurs when I access the innerXML property). However, if I use MSXML4 and load the file into a MSXML2.DOMDocument40Class document and parse through the nodes, I do not get an exception when iterating through the nodes....
    create datatable from xml without dataset (3 replies)
    microsoft.public.dotnet.xml
    Is it possible to create a datatable without a dataset object, and does anyone have some sample code they would be willing to share? thanks in advance
    Update/Delete/Insert data from XML (4 replies)
    microsoft.public.dotnet.xml
    Hi all, I've been though many posts in this group and have yet to find one that helps me understand how to accomplish my goal. I have an XML document that stores user specific values that I need to maintain based on options they select in a web app. Here's the XML: ?xml version "1.0" encoding "utf 8" ? MyConfig UserInfo UserName Joe Schmoe /UserName ReportAttributes ReqdFields Field Name "Address"...
    How-To Dynamically Create Nested DataTables (4 replies, VIP)
    microsoft.public.dotnet.xml
    I can create this: ?xml version "1.0" standalone "yes" ? ConfigOpt record Field 1 Text # 1 /Field 1 Field 2 Text # 2 /Field 2 /record /ConfigOpt I want to create this: ?xml version "1.0" standalone "yes" ? ConfigOpt settings record Field 1 Text # 1 /Field 1 Field 2 Text # 2 /Field 2 /record record Field 1 Text # 3 /Field 1 Field 2 Text # 4 /Field 2 /record record Field 1 Text # 5 /Field 1 Field 2 ...
    putting processing instruction in the XML Document (4 replies, VIP)
    microsoft.public.dotnet.xml
    i ve an XML document loaded in the XmlDocument object. What i want is to put XML processing instruction in it such as ?xml stylesheet href "mysheet.xslt" type "text/xsl"/ . any help will be greatly appreciated
    Reading XML from Stream - Change with .NET 1.1 SP1? (6 replies, VIP)
    microsoft.public.dotnet.xml
    I am currently trying to use XML as the descriptive language of choice for communications between a process and its subprocess, using the redirected input and output streams from the child process. I had this operating before I installed SP1, but after the installation of SP1, creating an XmlTextReader from the Console.In TextReader seems to be trying to consume the stream to the EOF (which won't ...
    How to ignore Whitespace (4 replies, VIP)
    microsoft.public.dotnet.xml
    I thought when using an XmlTextReader object if you set the WhitespaceHandling value to None XmlTextReader.Read() would ignore the carriage returns, Line Feeds and blanks. But run the following simple code and you will notice I am returning blanks. XmlTextReader oXmlReader new XmlTextReader(@"\\server\XmlDirectory\TextXml.xml"); oXmlReader.WhitespaceHandling System.Xml.WhitespaceHandling.None; whi...
    Serializing a class with a string array (4 replies, VIP)
    microsoft.public.dotnet.xml
    I have a class that contains a string array. However, I can't get this object to serialize in the xml output. Is there a trick to get a string[] to serialize? Thanks Amy.
    XmlSchemaElement.SchemaType returns null - bug? (3 replies, VIP)
    microsoft.public.dotnet.xml
    Hi all, I wrote some generator of classes from XSD files but encountred unexpected (for me) values in parsed DOM. First I load XSD with XmlSchema.Read() method, then iterate through XmlSchemaElements. I have a function IsComplex() which return bool value if it has simple content (e.g. type string, int,...) or complex one (sequence, choice, ..). This function looks like this: bool IsComplex(XmlSche...
    XmlSerializer does not deserialize elements /w specified namespace? (3 replies, VIP)
    microsoft.public.dotnet.xml
    Hi, the class looks like this: [XmlRootAttribute(Namespace "http://www.landxml.org/schema/LandXML 1.0",IsNullable false)] public gc class LandXML { public: ... }; public gc class Surfaces { public: ... }; and the element like this: Surfaces name "Triangles" xmlns "" .... /Surfaces If I remove the xmlns "" then the element is deserialized properly. But not when it is there. Why is this? The top ele...
    Write XML (3 replies)
    microsoft.public.dotnet.xml
    Hi. I'm new to XML and have a big problem. I should write a program that can show any XML File in a TreeView. Thats no problem. Furthermore I should be able to change any entry in the Treeview and write the changes back into the XML File. And thats the problem. It would be easy if I would know the structure of the XML File but as i said the program should be able to edit any XML File. I found out ...
    getting intellisense for custom XML (6 replies)
    microsoft.public.dotnet.xml
    Hi: I have created an xsd from my xml document. I pop this xsd in the following directory: C:\program files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml. That give me intellisense when I specify the name space. But leaving hte namespace in messes up my transforms. Is there any way to get this intellisense functionality without adding the namespace all the time? Thanks, Do
    using and caching multiple schema in ASP.NET C# (2 replies, VIP)
    microsoft.public.dotnet.xml
    I'm trying to use an overload of the xmlschemacollection but I don't understand what I'm doing wrong. Im trying to cache xsd s that have a targetnamespace that is a URI. The code I modified has xsd s that have targetnamespaces that are URNs. I thought that I could just substitute the URI for the URN and the xmlschemacollection would still work properly, but I'm doing something that is not correct....
    XmlReader - Cloning (2 replies, VIP)
    microsoft.public.dotnet.xml
    Hello All, I have a function that returns a xmlreader to me then I run the following code : XmlReader rdr dal.GetData XPathDocument Doc new XPathDocument(rdr); //*HERE*// rdr.Close(); XPathNavigator nav Doc.CreateNavigator(); But before I close the rdr I would like to run the follwing code : rdr.MoveToContent(); string xml rdr.ReadOuterXml(); But I am unable to run the above as it is empty after a...
    Ability to control what tags/elements have namespaces in them (2 replies, VIP)
    microsoft.public.dotnet.xml
    Hello! I am putting together XML messages from serialized classes generated from xsd.Because I am generating digital signatures from part of the message, I need greater control over when namespaces get written into the first element. If I try and use the following lines of code: ns.Add("", "") ns.Add("xsi", "http://www.w3.org/2001/XMLSchema instance") Dim serializer As XmlSerializer New XmlSeriali...
    Order of serialization of attributes (2 replies, VIP)
    microsoft.public.dotnet.xml
    Hi, is there a way to control the order XmlSerializer serializes attributes? With this class, value is serialized before value. Although it shouldn't matter, I would like it the other way around, just for style. Property value "" label "name" / public gc class Property { public: Property(); Property(System::String* l, System::String* v); [System::Xml::Serialization::XmlAttributeAttribute] property...
    XMLREADER (2 replies, VIP)
    microsoft.public.dotnet.xml
    If I run the following code : XmlReader rdr dal.Getxxxx rdr.MoveToContent(); string xmlstring rdr.ReadOuterXml(); how can I load the string back to a XPathDocument or a XPathNavigator. hmm does anyone know ? David Price
    XmlNamespaceManager.LookupPrefix problem. (2 replies)
    microsoft.public.dotnet.xml
    Hi All, I have the following code: snip XmlDocument xmlDoc new XmlDocument(); xmlDoc.LoadXml(@" ?xml version ""1.0"" encoding ""UTF 8""? myConfig:myConfig xmlns:myConfig ""http://mycomp/myConfig.xsd"" myConfig:title My Title /myConfig:title /myConfig:myConfig "); XmlNamespaceManager namespaceManager new XmlNamespaceManager(xmlDoc.NameTable); namespaceManager.AddNamespace("myConfig", "http://mycomp...
    XML is UTF-16 encoding but I want UTF-8 encoding ? (3 replies)
    microsoft.public.dotnet.xml
    Hi there XML Gurus ;) I am trying to use XML Serialization to create a xml from a class, this is the output which I get when I create the XML and put in a string variale. " ?xml version \"1.0\" encoding \"utf 16\"? OutBS FirstName XML /FirstName LastName Guru /LastName MemberName guru@xml.com /MemberName /OutBS " My question is why am I getting the encoding as UTF 16, I want a UTF 8 encoding, how ...
    Validating Exceptions with XmlValidatingReader at Schema with xsd:include (6 replies, VIP)
    microsoft.public.dotnet.xml
    Hi, i have a Problem with XmlValidatingReader. i validate a Catalog with BMECAT schematas an get the exception: Error:System.Xml.Schema.XmlSchemaException: Type 'dtSTRING' is not declared or not a simple type. An error occurred at file:bmecat base 1 2.xsd, (105, 3). The File: bmecat base 1 2.xsd is a xsd:include in bmecat new catalog 1 2.xsd. The Type 'dtSTRING' is declared. my source code: //////...
    root from Schema (2 replies, VIP)
    microsoft.public.dotnet.xml
    Hi all, does anybody know how to get all possible roots form XML Schema? I think all elements without parents are possible roots. Is it true?? Thanks, Petr.
    Reading/altering an .xml document (2 replies, VIP)
    microsoft.public.dotnet.xml
    Hey guys I'm fairly new to .NET and am trying to do the following: Read in one ..xml document, selectively remove and/or change certain nodes within it, then save the results in a second document. For instance, if I have: a name "a" b name "b" miscattr "blah" c name "c1"/ c name "c2"/ /b /a I want to convert that into: a name "a" b name "b" miscattr "blah" c name "c3"/ c name "c4"/ c name "c5"/ /b...
    XmlSchema classes help needed (2 replies, VIP)
    microsoft.public.dotnet.xml
    Hi All, I am having hard time figuring out how to programmatically construct a schema with following comple type: xs:complexType name "A" xs:sequence xs:element minOccurs "1" maxOccurs "1" name "B" type "B" / xs:element minOccurs "1" maxOccurs "1" name "C" type "C" / /xs:sequence xs:anyAttribute /xs:complexType Specifically I can not find any way to insert the "XmlSchemaAnyAttribute" instance into...
    Problem with inheriting from XmlElement class (3 replies, VIP)
    microsoft.public.dotnet.xml
    Hi! I have this class: public class StoredItemElement : XmlElement { protected internal StoredItemElement(string prefix, string localName, string namespaceUri, XmlDocument doc) : base(prefix, localName, namespaceUri, doc) { } .... } which inherits from XmlElement. But when I try this: XmlDocument doc new XmlDocument(); doc.Load("File.xml"); StoredItemElement element (StoredItemElement)doc.SelectSi...
    xml serialization of a class and adding qualified namespace (2 replies)
    microsoft.public.dotnet.xml
    I am successfully serializing to XML from a class like this: private static void CreateXML() { testClass c new testClass(); c.stringElement "data1"; c.stringElement2 "data2"; subClassDataType s new subClassDataType(); s.subThingElement1 "data3"; s.subThingElement2 "data4"; c.subThing s; XmlSerializer mySerializer new XmlSerializer(typeof(testClass)); System.IO.StreamWriter myWriter new System.IO.S...
    Transforming a typed dataset (2 replies)
    microsoft.public.dotnet.xml
    Hello, I need to reorder a Typed DataSet in memory using an Xsl Transform. Most of the examples use stream which write to the hard disk or xml file. I want to do this in memory and then write the resulting Typed Dataset into a Session object which will be reused on multiple postbacks and then finally saved when editing is done. Get various problems depending on what objects I use, rather than go t...
    DataSet.ReadXmlSchema chokes on uddi_v3.xsd (2 replies)
    microsoft.public.dotnet.xml
    I am trying to read the standard UDDI schema using a DataSet. however, it always chokes with error. Here are the full details: Schema used: http://uddi.org/schema/uddi v3.xsd C# (.NET) calls made: public readonly DataSet Schema; Schema new DataSet(); Schema.ReadXmlSchema(this.SchemaFile); Following exception is returned: System.Data.DataException: Undefined data type: 'validationTypeString4096'. a...
    xmp app.config (3 replies, VIP)
    microsoft.public.dotnet.xml
    I am working on an app.config application. I can read/modify key in the application itself, but I do not know how to upload another app.config file (treat as an xml file) that is in my c:, or d: drive. I also want to be able to read/write/modify/delete key when I upload the file. I will be very gread if anyone help. Thank you very much. Here is what my application look like: the app.config ?xml ve...
    XSDObjectGen error (5 replies, VIP)
    microsoft.public.dotnet.xml
    Hi, I received an error from a schema using the much hyped XSDObjectGen: Unexpected error occured in XSDObjectGen : Specified cast is not valid. Please send the schema to support. However xsd.exe (.NET v1.1) worked ok (did'nt give an error). I wonder how long we'll have to wait before we get a stable and comprehensive conversion from schema to class.
    Transforming XSLT with <xsl:include...> to a local file (2 replies, VIP)
    microsoft.public.dotnet.xml
    I simply need to be able to transform an XSLT document that uses an xsl:include href &quot;Common.xslt&quot; / tag. The Common.xslt file is in the same folder as the base xslt file being transformed (the &quot;XSLT&quot; folder). With MSXML, this just worked. Now I'm trying to understand how to get this to work with .NET and the XmlResolver object. Apparently the XSL transformation engine is looking for the &quot;Common.x...
    whitespace in empty nodes after save (6 replies, VIP)
    microsoft.public.dotnet.xml
    Loading and saving a xml document in .net creates whitespace in empty nodes! loading an empty node like: node /node ..net saves as: node /node resulting in a whitespace when processed by xslt like: xsl:value of select &quot;node&quot;/ Can the whitespace be removed from empty nodes before saving in .net ?? /mik
    setting default namespace ? (7 replies, VIP)
    microsoft.public.dotnet.xml
    How can I set the default namespace of an XmlDocument/XmlElement? I've tried doing something like rootElement.SetAttribute( &quot;xmlns&quot;, &quot;http://www.w3.org/2000/xmlns/&quot;, &quot;http://www.some.org/theschema&quot; ); on the DocumentElement. However, this fails. Any ideas?? Thanks. Joost
    Possible to force output format of empty elements? (5 replies, VIP)
    microsoft.public.dotnet.xml
    I have built a small integration app using VS .NET 2003 that extracts orderinformation from a 'webshop'. Extracting the orderinformation works fine. Appending the order elements in the XmlDocument was also done in a jiffy. The final step is to save the document to disk and then ship it to another system using ftp. The xml orderfile produced must fit a set specification of the recieving system. Tha...
    Help with XPathExpression, please. (5 replies, VIP)
    microsoft.public.dotnet.xml
    Hi, from an XML beginner.. I have an XML like the one below: root vendor name &quot;Microsoft&quot; ! additional sub tags and items /vendor vendor name &quot;Sun&quot; ! additional sub tags and items /vendor vendor name &quot;Borland&quot; ! additional sub tags and items /vendor /root Now, what's the correct XPathExpression to select only one vendor, let's say Microsoft (in the code below)...? XPathDocument Doc new XPathDocume...
    HTML to XML (3 replies, VIP)
    microsoft.public.dotnet.xml
    I have to browse to certain ebusiness portals, download their webpages (JSP or ASP). Then I have to parse to into those webpage HTML blocks (by accessing browser.document.body.innerHTML...) to pickout the table that contains records of my interest (the table in HTML table format... Table... /Table ) Now I would like to use some .NET objects (such as XML or DOM objects, etc...) to manipulate those ...
    Visit the archive for messages from this site.
  • October 2001 (79 items)
  • November 2001 (34 items)
  • December 2001 (27 items)
  • January 2002 (45 items)
  • February 2002 (67 items)
  • March 2002 (94 items)
  • April 2002 (67 items)
  • May 2002 (92 items)
  • June 2002 (58 items)
  • July 2002 (105 items)
  • August 2002 (86 items)
  • October 2002 (56 items)
  • January 2003 (77 items)
  • February 2003 (65 items)
  • March 2003 (56 items)
  • July 2003 (106 items)
  • January 2004 (415 items)
  • February 2004 (134 items)
  • March 2004 (83 items)
  • April 2004 (208 items)
  • May 2004 (92 items)
  • June 2004 (124 items)
  • July 2004 (84 items)
  • August 2004 (239 items)
  • September 2004 (88 items)
    Ad
    MBR BootFX
    Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
     
     Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
    Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com