Search Results

Search found 15718 results on 629 pages for 'xml'.

Page 1/629 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • XML Schema: Namespace issues when importing shared elements

    - by netzwerg
    When trying to import shared definitions from a XML Schema, I can properly reference shared types, but referencing shared elements causes validation errors. This is the schema that imports the shared definitions (example.xsd): <?xml version="1.0" encoding="UTF-8"?> <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:shared="http://shared.com"> <xs:import namespace="http://shared.com" schemaLocation="shared.xsd"/> <xs:element name="example"> <xs:complexType> <xs:sequence> <xs:element ref="importedElement"/> <xs:element ref="importedType"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="importedElement"> <xs:complexType> <xs:sequence> <xs:element ref="shared:fooElement"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="importedType"> <xs:complexType> <xs:sequence> <xs:element name="bar" type="shared:barType"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> These are the shared definitions (shared.xsd): <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://shared.com" targetNamespace="http://shared.com"> <xs:element name="fooElement"> <xs:simpleType> <xs:restriction base="xs:integer"/> </xs:simpleType> </xs:element> <xs:simpleType name="barType"> <xs:restriction base="xs:integer"/> </xs:simpleType> </xs:schema> Now consider this XML instance: <?xml version="1.0"?> <example xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="example.xsd"> <importedElement> <fooElement>42</fooElement> </importedElement> <importedType> <bar>42</bar> </importedType> </example> When validated, the "importedType" works perfectly fine, but the "importedElement" gives the following error: Invalid content was found starting with element 'fooElement'. One of '{"http://shared.com":fooElement}' is expected I would guess that my troubles are related to namespace issues (hence the somehow misleading "got fooElement but was expecting fooElement") -- any hints on what's wrong here?

    Read the article

  • Alternative for namespaces in xml

    - by mridul4c
    I have a web-service which gives a xml feed for number of clients of us, our clients consumes the xml in different types of devices. In our XML we have some namespaces also. But one of our clients can't detect namespaces because of some limitation at their end. But I can't provide a new xml for him as well. Please suggest me something so that I can satisfy the needs of namespaces without using that, so that i can change my xml to be usable by all of them. Thanks in advance.

    Read the article

  • Use XQuery to Access XML in Emacs

    - by Gregory Burd
    There you are working on a multi-MB/GB/TB XML document or set of documents, you want to be able to quickly query the content but you don't want to load the XML into a full-blown XML database, the time spent setting things up is simply too expensive. Why not combine a great open source editor, Emacs, and a great XML XQuery engine, Berkeley DB XML? That is exactly what Donnie Cameron did. Give it a try.

    Read the article

  • Validating an XML document fragment against XML schema

    - by shylent
    Terribly sorry if I've failed to find a duplicate of this question. I have a certain document with a well-defined document structure. I am expressing that structure through an XML schema. That data structure is operated upon by a RESTful service, so various nodes and combinations of nodes (not the whole document, but fragments of it) are exposed as "resources". Naturally, I am doing my own validation of the actual data, but it makes sense to validate the incoming/outgoing data against the schema as well (before the fine-grained validation of the data). What I don't quite grasp is how to validate document fragments given the schema definition. Let me illustrate: Imagine, the example document structure is: <doc-root> <el name="foo"/> <el name="bar"/> </doc-root> Rather a trivial data structure. The schema goes something like this: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="doc-root"> <xsd:complexType> <xsd:sequence> <xsd:element name="el" type="myCustomType" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name="myCustomType"> <xsd:attribute name="name" use="required" /> </xsd:complexType> </xsd:schema> Now, imagine, I've just received a PUT request to update an 'el' object. Naturally, I would receive not the full document or not any xml, starting with 'doc-root' at its root, but the 'el' element itself. I would very much like to validate it against the existing schema then, but just running it through a validating parser wouldn't work, since it will expect a 'doc-root' at the root. So, again, the question is, - how can one validate a document fragment against an existing schema, or, perhaps, how can a schema be written to allow such an approach. Hope it made sense.

    Read the article

  • gwt+xml- can i read through incomplete XML using the GWT XML Parser

    - by Arvind
    I have a requirement where a user is typing in XML in a text area, and I want to show the various nodes in a tree...But as the user is typing in the xml, it wont be a complete xml (since he is still typing in the XML)... How do I read an incomplete XML and correctly generate the tree? I understand how to read an xml and generate nodes in the tree, what I want to know is, how to read the incomplete XML as it is being typed in

    Read the article

  • Why isn't the Spring AOP XML schema properly loaded when Tomcat loads & reads beans.xml

    - by chrisbunney
    I'm trying to use Spring's Schema Based AOP Support in Eclipse and am getting errors when trying to load the configuration in Tomcat. There are no errors in Eclipse and auto-complete works correctly for the aop namespace, however when I try to load the project into eclipse I get this error: 09:17:59,515 WARN XmlBeanDefinitionReader:47 - Ignored XML validation warning org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/aop/spring-aop-2.5.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not . Followed by: SEVERE: StandardWrapper.Throwable org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 39 in XML document from /WEB-INF/beans.xml is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aop:config'. Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aop:config'. Based on this, it seems the schema is not being read when Tomcat parses the beans.xml file, leading to the <aop:config> element not being recognised. My beans.xml file is as follows: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> <!--import resource="classpath:META-INF/cxf/cxf.xml" /--> <!--import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /--> <!--import resource="classpath:META-INF/cxf/cxf-servlet.xml" /--> <!-- NOTE: endpointName attribute maps to wsdl:port@name & should be the same as the portName attribute in the @WebService annotation on the IWebServiceImpl class --> <!-- NOTE: serviceName attribute maps to wsdl:service@name & should be the same as the serviceName attribute in the @WebService annotation on the ASDIWebServiceImpl class --> <!-- NOTE: address attribute is the actual URL of the web service (relative to web app location) --> <jaxws:endpoint xmlns:tns="http://iwebservices.ourdomain/" id="iwebservices" implementor="ourdomain.iwebservices.IWebServiceImpl" endpointName="tns:IWebServiceImplPort" serviceName="tns:IWebService" address="/I" wsdlLocation="wsdl/I.wsdl"> <!-- To have CXF auto-generate WSDL on the fly, comment out the above wsdl attribute --> <jaxws:features> <bean class="org.apache.cxf.feature.LoggingFeature" /> </jaxws:features> </jaxws:endpoint> <aop:config> <aop:aspect id="myAspect" ref="aBean"> </aop:aspect> </aop:config> </beans> The <aop:config> element in my beans.xml file is copy-pasted from the Spring website to try and remove any possible source of error Can anyone shed any light on why this error is occurring and what I can do to fix it?

    Read the article

  • Create an XML file using Datasets Using info from XML Schema

    - by Voulnet
    Hello there, I have been thinking about the optimal way to create an XML file using data from a Dataset AND according to the rules of an XML schema. I've been searching around for a bit, and I failed to find a way in which I only take the data from the Dataset and put it inside a XML tags, with the tags being defined by an already-existing schema. So it might go like this: 1- Create Dataset and fill its rows with data. 2- Create an XML according to an XML schema rules. 3- Fill said XML file with data from Dataset such that data is taken from the Dataset while structure of the XML file is taken from the XML schema.

    Read the article

  • XML Serialization in C# without XML attribute nodes

    - by Alex Marshall
    Hello, I have an XML document format from a legacy system that I have to support in a future application. I want to be able to both serialize and deserialize the XML between XML and C# objects, however, using the objects generated by xsd.exe, the C# serialization includes the xmlns:xsi..., xsi:... etc XML attributes on the root element of the document that gets generated. Is there anyway to disable this so that absolutely no XML attribute nodes get put out in the resulting XML ? The XML document should be elements only. Duplicate? XmlSerializer: remove unnecessary xsi and xsd namespaces

    Read the article

  • <?xml version=“1.0” encoding=“UTF-8”?> not <?xml version='1.0' encoding='UTF-8'?>

    - by user2446702
    I am using lxml with tree.write(xmlFileOut, pretty_print = True, xml_declaration = True, encoding='UTF-8' to write out my opened and edited xml file, but I absolutely need to have the xml declaration as <?xml version=“1.0” encoding=“UTF-8”?> and NOT <?xml version='1.0' encoding='UTF-8'?> Now I know they are exactly the same when it comes to xml, but I am dealing with a very tricky customer who absolutely has to have " in the declaration and not '. I have searched everywhere but can't find the answer. Could I create it and add it in myself to the head of the xml somehow? Could I tell lxml that this is what I need as an xml declaration?

    Read the article

  • Using VTD-XML to modify element text only

    - by Algorist
    Hi, I want to achieve below thing in vtd-xml xml modifier class. Original xml <xml> <element attr1='1' attr2='2' attr3='3'>text</element> </xml> int p = vn.getText() xm.updateToken(p, "new text"); But the code here is not modifying the text to new text. Any idea how to achieve this? Other option is to call xm.remove() and then add tag. But, I am not able to retain the attributes. Thank you Bala

    Read the article

  • Wrapping Arbitrary XML within XML

    - by Marc C
    I need to embed arbitrary (syntactically valid) XML documents within a wrapper XML document. The embedded documents are to be regarded as mere text, they do not need to be parseable when parsing the wrapper document. I know about the "CDATA trick", but I can't use that if the inner XML document itself contains a CDATA segment, and I need to be able to embed any valid XML document. Any advice on accomplishing this--or working around the CDATA limitation--would be appreciated.

    Read the article

  • XML Parsing from Non-XML Document

    - by Neel Basu
    in a xml/non-xml File there may exist some XML Block that I need to parse and replace with some other string.. The Scenario is something like this.. Some Text <cnt:use name="abc" call="xyz"> <cnt:param name="x" value="2" /> </cnt:use> Some Text There is no guarantee that the document is a proper XML document. (there may exist some unclosed Tags. or some other common mistakes that a Stupid people can make while typing HTML). so I can't use SAX or DOM. I can't even pass it to XSLT (am I right ?). So Whats the best way to extract the <cnt:*> part from the non-xml Document. and read it then replace with something else.

    Read the article

  • How to transport an XML fragment in an XML Document

    - by mrwayne
    Hi, I'm using an AJAX system on a web application, and for one of the objects i return, it needs to contain an xml fragment. Unfortunately, being AJAX, i'm sending the values back via XML already. So, at the moment, i have something that looks like this (ignoring the fact the tags arent perfect. <Transport> <Message> <Content><[CDATA...] XML Content in here </Cdata></Content> </Message> </Transport> This has worked pretty well for the last few years, however, now the XML content itself needs to contain its own CDATA tags and its causing me grief because you cannot nest CDATA sections. Is there another way to encode the 'XML Content' internally?

    Read the article

  • Programatically determining which node in an XML document caused validation against its XML Schema t

    - by jd1212
    My input is a well-formed XML document and a corresponding XML Schema document. What I would like to do is determine the location within the XML document that causes it to fail validation against the XML Schema document. I could not figure out how to do this using the standard validation approach in Java: SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(... /* the .xsd source */); Validator validator = schema.newValidator(); DocumentBuilderFactory ... DocumentBuilder ... Document document = DocumentBuilder.parse(... /* the .xml source */); try { validator.validate(new DOMSource(document)); ... } catch (SAXParseException e) { ... } I have toyed with the idea of getting at least the line and column number from SAXParseException, but they're always set to -1, -1 on validation error.

    Read the article

  • Free lightweight XML text editor to include with an application

    - by Heinzi
    Our application uses a XML configuation file. I thought that it would be nice to distribute some small, lightweight XML editor with our application that the user can use to edit the config file. Features should be: Small and lightweight (ideally, a small .exe that does not require installation), free, with license terms that permit distributing it with a commercial application, understands XML schemas (auto-completion, show validation errors). Does anyone know of such an editor?

    Read the article

  • Store XML,update record in XML,retrive a specific record in XML stored on BB device

    - by user469999
    I am writing a blackberry application where i want to store the data returned by a web service in my BB device.Earlier i was going to use SQLite for storing the data in mobile but as i googled and also did programming using SQLite and found that some BB devices dont support SQLite library and fail to create the database.Then i decided to keep the data returned by webservice in a XML format on my BB device. I just want to know is there any method or way in blackberry through which i can parse the data stored in xml,update it,or directly access a particular record stored in the xml instead of traversing the whole xml n times and finding the matched record. Please guide me as i am new to storing data in BB device.Is the approach which i am thinking to store data in XML right or shall i use something else Thanks in advance Yogesh Chaudhari

    Read the article

  • Expose DB2 data as XML / Query DB2via XML

    - by Anthony Gatlin
    I have a client who has a sort of data warehouse stored in DB2. For a variety of reasons, the data must remain on this platform. The client is considering implementing an open-source CMS (Drupal) which runs in MySQL. The client needs to be able to execute a bunch of pre-defined queries against the DB2 database from the remote application. Drupal appears to interact well with XML data from other systems. It was suggested that we use something like XML-RPC to execute the queries against DB2. I am very familiar with SQL Server and pretty familiar with MySQL, but I have no experience with DB2 and no understanding of its capabilities or limitations. Is there any way that we can use something like XML, XML-RPC, or even http to initiate queries against a DB2 database? Any ideas are appreciated! Thank you!

    Read the article

  • Linq to XML - update/alter the nodes of an XML Document

    - by knox
    Hello! If got 2 Questions: 1. I've sarted working around with Linq to XML and i'm wondering if it is possible to change a XML document via Linq. I mean, is there someting like XDocument xmlDoc = XDocument.Load("sample.xml"); update item in xmlDoc.Descendants("item") where (int)item .Attribute("id") == id ... 2. I already know how to create and add a new XMLElement by simply using xmlDoc.Element("items").Add(new XElement(......); but how can i remove a single entry. XML sample data: <items> <item id="1" name="sample1" info="sample1 info" web="" /> <item id="2" name="sample2" info="sample2 info" web="" /> </itmes>

    Read the article

  • Update XML element with LINQ to XML in VB.NET

    - by Bayonian
    Hi, I'm trying to update an element in the XML document below: Here's the code: Dim xmldoc As XDocument = XDocument.Load(theXMLSource1) Dim ql As XElement = (From ls In xmldoc.Elements("LabService") _ Where CType(ls.Element("ServiceType"), String).Equals("Scan") _ Select ls.Element("Price")).FirstOrDefault ql.SetValue("23") xmldoc.Save(theXMLSource1) Here's the XML file: <?xml version="1.0" encoding="utf-8"?> <!--Test XML with LINQ to XML--> <LabSerivceInfo> <LabService> <ServiceType>Copy</ServiceType> <Price>1</Price> </LabService> <LabService> <ServiceType>PrintBlackAndWhite</ServiceType> <Price>2</Price> </LabService> </LabSerivceInfo> But, I got this error message: Object reference not set to an instance of an object. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Error line:ql.SetValue("23") Can you show me what the problem is? Thank you.

    Read the article

  • Diff 2 large XML files to produce a delta xml file

    - by aniln
    Need to be able to diff 2 large / very large XML files and produce the delta XML file. Also, as this process will be part of a larger automated process on below hardware / OS config. Machine hardware: sun4v OS version: 5.10 Processor type: sparc Hardware: SUNW,SPARC-Enterprise-T5220 Please let me know if there's an installable application on Solaris which can be called as part of a ksh script Example: Run driver_script.ksh Above script will have a line: xml_delta file1.xml file2.xml delta_file.xml where xml_delta is the installable application which produces the delta file after comparing file1.xml and file2.xml

    Read the article

  • Problem with develop of XML Schema based on an existent XML

    - by farhad
    Hello! I have a problem with the validation of this piece of XML: <?xml version="1.0" encoding="UTF-8"?> <i-ching xmlns="http://www.oracolo.it/i-ching"> <predizione> <esagramma nome="Pace"> <trigramma> <yang/><yang/><yang/> </trigramma> <trigramma> <yin/><yin/><yin/> </trigramma> </esagramma> <significato>Questa combinazione preannuncia <enfasi>boh</enfasi>, e forse anche <enfasi>mah, chissa</enfasi>.</significato> </predizione> <predizione> <esagramma nome="Ritorno"> <trigramma> <yang/><yin/> <yin/> </trigramma> <trigramma> <yin/><yin/><yin/> </trigramma> </esagramma> <significato>Si prevede con certezza <enfasi>qualcosa</enfasi>, <enfasi>ma anche <enfasi>no</enfasi></enfasi>.</significato> </predizione> </i-ching> This XML Schema was developed with Russian Dolls technique: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.oracolo.it/i-ching" targetNamespace="http://www.oracolo.it/i-ching" > <xsd:element name="i-ching"> <xsd:complexType> <xsd:sequence> <xsd:element name="predizione" minOccurs="0" maxOccurs="64"> <xsd:complexType> <xsd:sequence> <xsd:element name="esagramma"> <xsd:complexType> <!-- vi sono 2 trigrammi --> <xsd:sequence> <xsd:element name="trigramma" minOccurs="2" maxOccurs="2"> <xsd:complexType> <xsd:sequence minOccurs="3" maxOccurs="3"> <xsd:choice> <xsd:element name="yang"/> <xsd:element name="yin"/> </xsd:choice> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> <xsd:attribute name="nome" type="xsd:string"/> </xsd:complexType> </xsd:element> <!-- significato: context model misto --> <xsd:element name="significato"> <xsd:complexType mixed="true"> <xsd:sequence> <xsd:element name="enfasi" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> For exercise I have to develop an XML Schema to validate the previous XML. The problem is that oxygen says me this: cvc-complex-type.2.4.a: Invalid content was found starting with element 'predizione'. One of '{predizione}' is expected. Start location: 3:6 End location: 3:16 URL: http://www.w3.org/TR/xmlschema-1/#cvc-complex-type why? is it something wrong with my xml schema? thank you very much

    Read the article

  • Reading php generated XML in flash?

    - by AdonisSMU
    Here is part 1 of our problem (Loading a dynamically generated XML file as PHP in Flash). Now we were able to get Flash to read the XML file, but we can only see the Flash render correctly when tested(test movie) from the actual Flash program. However, when we upload our files online to preview the Flash does not render correctly, missing some vital information(thumbnails, titles, video etc..). Here is a link to the Flash file using a manually created XML file (The Flash renders correctly): http://www.gaban.com/stackoverflow/TEN_xml.html Here is the path to the manually created XML file: http://dev.touchstorm.com/ten_hpn_admin2/client_user2.xml Now here is the link to the Flash file using the PHP generated XML file (Renders incomplete): http://www.gaban.com/stackoverflow/TEN_php.html Path to the PHP generated file (exactly the same as the manually created one): http://dev.touchstorm.com/ten_hpn_admin2/client_user.php?id=2 Additional information: The SWF file exists on Domain 1 The XML & PHP file both exists on Domain 2 And the HTML file with the embed code lies on Domain 3 Wondering if this could be a crossdomain issue? We have one of those files in place on Domain 1 & 2 where we have access too, however for Domain 3 we can't have a crossdomain.xml file there. Here is the PHP code: $xml = new XMLWriter(); $xml->openMemory(); $xml->setIndent(true); $xml->setIndentString("\t"); $xml->startDocument(); $xml->startElement('data'); $xml->startElement('config'); $xml->startElement('hex'); $xml->writeCData('0x' . $widget_profile['background_color']); $xml->endElement(); $xml->startElement('width'); $xml->writeCData($widget_profile['width']); $xml->endElement(); $xml->startElement('height'); $xml->writeCData($widget_profile['height']); $xml->endElement(); $xml->startElement('fullscreen'); $xml->writeCData('false'); $xml->endElement(); $xml->startElement('special'); $xml->writeCData('false'); $xml->endElement(); $xml->startElement('specialName'); $xml->writeCData('Tools & Offers'); $xml->endElement(); $xml->startElement('specialLink'); $xml->writeCData('http://bettycrocker.com'); $xml->endElement(); $xml->startElement('client'); $xml->writeCData($widget_profile['site_url']); $xml->endElement(); $xml->endElement(); if (count($widget_content) > 0) { foreach ($widget_content as $tab) { $xml->startElement('tab'); $xml->writeAttribute('id', $tab['tabname']); if (count($tab['video']) > 0) { foreach ($tab['video'] as $video) { $video_sql = "select VID, flvdoname, title from video where VID='" . $video . "'"; $video_result = $howdini->query($video_sql); if ($video_result->rowCount() > 0) { foreach ($video_result as $video_row) { $video_row['flvdoname'] = substr($video_row['flvdoname'], 35, -4); $xml->startElement('vid'); $xml->writeAttribute('flv', $video_row['flvdoname']); $xml->writeAttribute('thumb', 'http://www.howdini.com/thumb/' . $video_row['VID'] . '.jpg'); $xml->writeAttribute('title', $video_row['title']); $xml->endElement(); } } } } $xml->endElement(); } } $xml->endElement(); $xml->endDocument(); header('Content-Type: text/xml; charset=UTF-8'); echo $xml->flush(); Thanks in advance for any answers! EDIT: I have included the change and now Firebug sees the XML. Now it's just not seeing the swf file but I can see the swf file in other parts of the page.

    Read the article

  • Serializing java objects with respect to xml schema loaded at runtime

    - by kohomologie
    I call an XML document three-layered if its structure is laid out as following: the root element contains some container elements (I'll call them entities), each of them has some simpleType elements inside (I'll call them properties). Something like that: <data> <spaceship> <number>1024</number> <name>KTHX</name> </spaceship> <spaceship> <number>1624</number> <name>LEXX</name> </spaceship> <knife> <length>10</length> </knife> </data> where spaceship is an entity, and number is a property. My problem is stated below: Given schema: an arbitrary xsd file describing a three-layered document, loaded at runtime. xmlDocument: an xml document conforming to the schema. Create A Map<String, Map <String, Object>> containing data from the xmlDocument, where first key corresponds to entity, second key correponds to this entity's property, and the value corresponds to this property's value, after casting it to a proper java type (for example, if the schema sets the property value to be xs:int, then it should be cast to Integer). What is the easiest way to achieve this result with existing libraries? P. S. JAXB is not really an option here. The schema might be arbitrary and unknown at compile-time. Also I wish to avoid an excessive use of reflection (associated with converting the beans to maps). I'm looking for something that would allow me to make the typecasts while xml is being parsed.

    Read the article

  • delete element from xml using LINQ

    - by Shishir
    Hello I've a xml file like: <starting> <start> <site>mushfiq.com</site> <site>mee.con</site> <site>ttttt.co</site> <site>jkjhkhjkh</site> <site>jhkhjkjhkhjkhjkjhkh</site> <site>dasdasdasdasdasdas</site> </start> </starting> Now I need to delete any ... and value will randomly be given from a textbox. Here is my code : XDocument doc = XDocument.Load(@"AddedSites.xml"); var deleteQuery = from r in doc.Descendants("start") where r.Element("site").Value == txt.Text.Trim() select r; foreach (var qry in deleteQuery) { qry.Element("site").Remove(); } doc.Save(@"AddedSites.xml"); If I put the value of first element in the textbox then it can delete it, but if I put any value of element except the first element's value it could not able to delete! I need I'll put any value of any element...as it can be 2nd element or 3rd or 4th and so on.... can anyone help me out? thanks in advanced!

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >