xml

How to extract tags from XML

Hi, I have a simple XML extraction issue that should be solvable with straight PHP and not require any libraries. All I need to do is extract the values of one tag. For example, given the string of XML: <ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ....> <Result>Foo</Result> <Result>Bar</Result> </ResultSet> I j...

get all the elements that have a particular element name

My xml looks like this: <nodes><skus><sku>abc</sku><sku>def123</sku></skus></nodes> I want to get all the elements with the name 'sku' I have a XDocument already loaded with the xml. List<XElement> elements = doc.Elements.Where( ??? ) or would I just do: doc.Elements("sku") ? I don't want this to return an error if there are n...

Can I serialize Anonymous Types as xml?

I understood that anonymous types are marked private by the compiler and the properties are read-only. Is there a way to serialize them to xml (without deserialize) ? It works with JSON, how can I do it with XML? ...

WCF Web Service Response XML file.

I am using a data contract in WCF, but there is some unwanted response tags being sent in the xml file, I am not sure how to modify the data contract class so that I can avoid sending that unwanted response field. In the below XML file, all the text which is bolded and italics is unwanted. Thanks. <GetCertMailReceiptNumbersResponse xm...

Perl XML::Simple XMLout function

I pass in the following XML to XMLin: <root foo="bar" foo2="bar2"> <pizzas> <pizza>Pepperoni</pizza> </pizzas> </root> I then edit part of the root element via hash array. I don't care about the pizza, but I do need that XML to come back out exactly as it was. However, I get the following from XMLout: <root foo="bar" foo2="bar2"> <...

Tinyxml Multi Task

I have a single xml file and every new thread of the program (BHO) is using the same Tinyxml file. every time a new window is open in the program, it runs this code: const char * xmlFileName = "C:\\browsarityXml.xml"; TiXmlDocument doc(xmlFileName); doc.LoadFile(); //some new lines in the xml.. and than save: doc.SaveFile(xmlFileName);...

C# LINQ to XML query with duplicate element names that have attributes

<Party id="Party_1"> <PartyTypeCode tc="1">Person</PartyTypeCode> <FullName>John Doe</FullName> <GovtID>123456789</GovtID> <GovtIDTC tc="1">Social Security Number US</GovtIDTC> <ResidenceState tc="35">New Jersey</ResidenceState> <Person> <Firs...

ORACLE XML publishing

Hey guys, I was wondering which tool in ORACLE 11g (their latest DBMS) can be used for publishing XML. I am about to download it but would first like to know the name of the XML publisher and where I could get more information about it from. Thanks in advance. S ...

XMLWriter syntax problems

I am trying to create an asp.net web form that allows a user to enter information, then have this information sent via an XMLwriter to a web service. Here is a snippet of the xml as it should be outputted; <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; <soap:Body xmlns:ns1="http://its/foo.wsdl"&gt; I try t...

Can I use XText for a DSL involving an XML file type?

I have defined a small DSL that is mostly written in the form of different types of XML files in conjuction with some property files. This works very well but I wish to create an Eclipse Editor to make editing these files easier for beginners (I already have a working parser). The main XML file can reference some items from the .propert...

Java: which configuration framework to use?

Hi, I need to decide which configuration framework to use. At the moment I am thinking between using properties files and XML files. My configuration needs to have some primitive grouping, e.g. in XML format would be something like: <configuration> <group name="abc"> <param1>value1</param1> <param2>value2</param2> ...

Get Nth child of a node using xpath

Hi, My sample input XML is: <root> <a> <b>item</b> <b>item1</b> <b>item2</b> <b>item3</b> <b>item4</b> </a> </root> I am suppose to select a node "b" whose position is the value of a variable, how to use the value of variable to test the position of a node? Best Reagards, Iordan ...

flex: move item around in a tree control

Hi everybody, I have a tree control and I want to give the user the ability that he can move up and down the element he just selected with a up and a downbutton. The tree gets generated from XML. I managed to insert the selected item a second time at a other place, with the following code: var parentXML:XML = XML(containerTree.selecte...

XML Schema design decision

I am designing an XML schema to hold the output of my program. However, I am hesitating concerning a design decision, and I would like the input of more experienced programmers. If I have a complex element <list> <elmt>1</elmt> <elmt>2</elmt> </list> However, the nested elements in <list> are optional. My question is how should the fi...

How to parse XML file to get specific data effectively

I have an XML file looks like this: <?xml version="1.0" encoding="utf-8" ?> <PathMasks> <Mask desc="Masks_X1"> <config id="01" mask="88" /> <config id="03" mask="80" /> <config id="51" mask="85" /> </Mask> <Mask desc="Masks_X2"> <config id="70" mask="1" /> <config id="73" mask="6" /> </Mask> <Types> <path id=...

xml schema putting both sequence and all under one complexType node

Here is the xml file: <section> <number>1</number> <title>A Title goes here...</title> <code>TheCode</code> <element></element> <element></element> </section> In section node, there are number, title and code node. Their sequence must not be fixed. Then, there are multiple element under section node as well. The ...

C# Style XML Comments in Delphi 2010

Hi, does Delphi 2010 have C# Style XML comments that show up when hovering over the method call? /// <summary> /// My comment here /// </summary> ...

generate structured (xml) document from hierarchical table data (T-SQL)

Hello people! I have a table like this (simplified): ID | Name | Parent --------------------------------- 1 | IND | NULL 2 | INS | 5 3 | CON | NULL 4 | AUT | 1 5 | FIN | NULL 6 | PHA | 1 7 | CFIN | 5 8 | CMRKT | 7 DDL: CREATE TABLE [dbo].[tblIndustryCodes]( ...

.NET XmlSerializer to Element FormDefault=Unqualified XML?

I use C# code more-or-less like this to serialize an object to XML: XmlSerializer xs1 = new XmlSerializer(typeof(YourClassName)); StreamWriter sw1 = new StreamWriter(@"c:\DeserializeYourObject.xml"); xs1.Serialize(sw1, objYourObjectFromYourClassName); sw1.Close(); I want it to serialize like this: <ns0:Header xmlns:ns0="https:/...

How do I apply a style to all buttons of an Android application

I have a style applied to my whole application: AndroidManifest.xml: <application android:theme="@style/ApplicationStyle" android:icon="@drawable/icon" android:label="@string/app_name"> And in my styles.xml: <style name="ApplicationStyle" parent="android:Theme"> <item name="android:button">@style/CKButton</item> </style> <style...