xml

Updating XML file using Boost property_tree

I have the following XML file: <xml version="1.0" encoding="utf-8"?> <Data> <Parameter1>1</Parameter1> </Data> I want to add a new node: Parameter2="2" to the Data node. This code doesn't work, saved file still contains only one parameter: boost::property_tree::ptree tree; boost::property_tree::ptree dataTree; read...

Powershell XML parse not working on subnodes

I am tring to parse the following file: <?xml version="1.0" encoding="UTF-8" ?> <printDrivers> <printDriver id="XE8550"> <inf>x28550p.inf</inf> <driverPath>\drivers\XEROX\8550\8550_Driver</driverPath> <printerPaths> <printerPath>\\print-man\man-25</printerPath> </printerPaths> </printDriver> ...

Will WCF automatically encode my XML conent?

E.g. the WCF Service creates an XDocument with an element like this: string content = &lt;Wibble&gt"; XDocument message = new XDocument( new XELement("ElName", content) ); Our clients are stating that they get the above back as: <ElName><Wibble></ElName> We've not found any decode code in our WCF service or their client code. I t...

XML Schema: comparing to date elements

I have an XML file like this: <?xml version="1.0" encoding="UTF-8"?> <items> <item id="1"> <valid_from>2010-07-09</valid_from> <valid_to>2010-07-12</valid_to> </item> <item id="2"> <valid_from>2010-07-09</valid_from> <valid_to>2009-07-12</valid_to> </item> </items> Is it possible to defi...

Having a Pretty-Printed XML file from the WriteXml of a Dataset in VB.NET

Hello all, I'm trying to use Dataset.WriteXml() function in VB.Net to generate an XML file with Pretty-Print Layout (I think this is how it's named) like the example below (Listing 1): <MainRoot> <Table1> <Col1>Value1</Col1> <Col2>Value2</Col2> <Col3></Col3> <Col4>Value4</Col4> </Table1> <Table2> ...

creating arrays in xslt

can array's be created and used in xslt? If so are there suitable examples online to study? If not is there a way to store values in a way that mimics an array? ...

Having a Pretty-Printed XML file from the WriteXml of a Dataset in VB.NET

Hello all, I'm trying to use Dataset.WriteXml() function in VB.Net to generate an XML file with Pretty-Print Layout (I think this is how it's named) like the example below (Listing 1): <MainRoot> <Table1> <Col1>Value1</Col1> <Col2>Value2</Col2> <Col3></Col3> <Col4>Value4</Col4> </Table1> <Table2> ...

Need to close a node only on a particular condition

Hi, Please find the 2 XML's Input XML- <feed xmlns:es="http://ucmservice"&gt; <element> <es:RepositoryDetails> <es:Repository Type="DatabaseRepository" /> <es:ConnetionDetails> <es:Param MigrationSetId="439" /> </es:ConnetionDetails> </es:RepositoryDetails> <es:DocProperties> <es:UniqueDocId Value="_1_15"...

XML - XSLT Transformation - producing special "<? ... ?>" tag

I am transforming some XML data to fit into document that is in a format of"Excel XML Spreadsheet 2003" It all works ok, but I have a problem with generating the proper header of the result file. It should basically be in a form of: <?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns="urn:schemas-microsoft-co...

POJO to XML mapping in Java to avoid breaking XHR

Let's say I have a simple POJO class: public void Foo { public int a; public int b; public Foo() { a = 0; b = 1; } } Is there some library in JAVA which will give me XML like this: <List> <a value='0'/> <b value='1'/> </List> I have a XHR service but I have to manually "dump" each member to ...

What is the best object to string XML serialization API for Java 1.4?

I want to generate a XML String for a given object. What is the best API to serialize an object to XML String using Java 1.4? Thanks, RT ...

issue with a XHR xml response in Google Chrome extension

I am integrating Highrise into a Google Chrome plugin and have issues with a XHR responding xml. I am pretty positive that Highrise API doesn't return a JSON. I have a XHR in "background-script" , then I pass the result into "content-script" with a chrome.tabs.sendRequest(tabId, { data :data }); and here is the issue I ne...

Alternative to ZIP as a project file format. SQLite or Other?

My Java application is currently using ZIP as a project file format. The project files contain a few XML files and many image and sound files. The project files are getting pretty big, and since I can't find a way with the java.util.zip classes to write to a ZIP file without recreating it, my file saves are becoming very slow. So for e...

Get a node's inner XML as String in Java DOM

I have an XML org.w3c.dom.Node that looks like this: <variable name="variableName"> <br /><strong>foo</strong> bar </variable> How do I get the <br /><strong>foo</strong> bar part as a String? ...

Extract ns:version from wsdl file using php?

Hello, I have attempted to extract an attribute from the paypal soap wsdl file using SimpleXml and DOM in php5 but they all skip over the root tag where the namespace declarations are. It is not clear to me yet how to get a node referencing the root tag so that I can retrieve the value of ns:version using the current attributes functi...

Creating XML from java classes with JAXB - how to use minOccurs and maxOccurs

I have a pretty large set of Java classes, many that stem from each other. I want to know how to specify in the java code (with an annotation) when a certain property of a class is limited. For example, a vehicle.java class should only be able to have 1 manufacturer and 2-4 wheels. I have come across minOccurs and maxOccurs in generate...

NoSQL and REST web-services

I understand that if you use SUN's Jersey REST implementation framework, you get the ability to use XML and JSON doc's interchangably. I've tried this in a simple REST service and it works just fine, marshalling XML or JSON to Java objects and back again without any problems. My Question is this..... Whats the simplest 'NoSQL' way to p...

Remove .xml extension from ActiveResource request

Hi, I am trying to use ActiveResource to consume xml data from a third party API. I can use the RESTClient app to successfully authenticate and make requests. I coded my app and when I make a request I get a 404 error. I added: ActiveResource::Base.logger = Logger.new(STDERR) to my development.rb file and figured out the problem. Th...

Serialize Object to XML in with specific format

Hello everyone. Im trying to Serialize an object( a class in this case) with an specific fomat. I got something like this: <ns:pay xmlns:ns="http://example.uri.here"&gt; <ns:Payment> <ns:customerKeyValue>5555</ns:customerKeyValue> <ns:bankCode>BBBB</ns:bankCode> <ns:paymentAmount>456</ns:paymentAmount> <ns:paymentCatego...

Sorting Prices from XML

Hey Everyone, I am trying to sort the results by prices of an xml with info related to hotels. I want to display and sort the data by prices, given by a value called minCostStay, so ASC and DESC are must to do this. I am using foreach to display the data endlessly. What I need to do now is sort out these data by price asc and desc. I a...