xml

Perform xml transformation and filtering in java

I'd like to filter a couple of nested xml elements, evaluation of their attributes. For this purposes I'm searching a efficient and lightweight java api or framework. The main requirements are: filtering of element bodies, based on some pattern or condition event based XML transformation My first idea was apache jelly, but jelly h...

XMLDecoder.readObject() returns null

Hi all, I'm trying to read an object from a XML file using XMLDecoder. The construction seems to be OK, but when I call the readObject() method i get null instead of the object I expected. The file exists and the created BufferedInputStream reads the file correctly. This code works OK on the original Vista laptop it was written on, but...

JAXB: How should I marshal complex nested data structures?

Hello! I have several complex data structures like Map< A, Set< B > > Set< Map< A, B > > Set< Map< A, Set< B > > > Map< A, Map< B, Set< C > > > and so on (more complex data structures) Note: In my case it doesn't really matter if I use Set or List. Now I know that JAXB let me define XmlAdapter's, that's fine, but I don't want to def...

My PHP app needs to export to a range of different XML formats: should I use XSLT or native PHP?

My PHP application will need to be able to export to (and import from) a range of different data formats, mostly XML based. I have the option of In PHP, use DOM to export to some XML based format that is a superset of all the data needed by the others, and create a separate XSLT stylesheet for each output format I want to support, run...

how to create a xml document on the fly with xquery?

Hi all, I what to use XQuery to convert string like "aaa=1&bbb=2" into xml <request> <aaa>1</aaa> <bbb>2</bbb> </request> I have tried the following code, but failed! xquery version "1.0" encoding "GBK"; (:: pragma type="xs:anyType" ::) declare namespace xf = "http://tempuri.org/BNetAP/Xquery/query2xml/"; declare function x...

Wrong Encoding in JAX-WS Dispatch Response

I'm trying to access a web service with JAX-WS using: Dispatch<Source> sourceDispatch = null; sourceDispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD); Source result = sourceDispatch.invoke(new StreamSource(new StringReader(req))); System.out.println(sourceToXMLString(result)); where: private static Str...

AS3: all key + values from XML attributes

<top> <item link="http://www.google.be"&gt;&lt;![CDATA[test]]&gt;&lt;/item&gt; <item link="http://www.google.be"&gt;&lt;![CDATA[test]]&gt;&lt;/item&gt; <item bold="true" link="http://www.google.be"&gt;&lt;![CDATA[test]]&gt;&lt;/item&gt; </top> I need to get all the attributes (both key and value) for each ( var item : XML in data.i...

XPaths and <? ?>

I have a WIX file that I need to modify using MSBuild. It starts like this: <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"&gt; <?--... Removed Params ...--> <?define ProductVersion = "1.0.1"?> <?--... Removed Params ......

Why is curl sending the command-line before the message body in an HTTP PUT?

I'm issuing the command (line broken for readability): curl -H"X-RequestIsAbsolutePath: F" \ -T /tmp/out \ -H'Content-Type: application/xml' \ "http://localhost:8182/metadata/036-Rotated.JPG" I'm sending a message body of XML. I get a complaint from the XML parser on the server about content not being allowed in the prolog. I added ...

How to select a file path using regex

I would like like to create a java regular expression that selects everything from file: to the last forward slash (/) in the file path. This is so I can replace it with a different path. <!DOCTYPE "file:C:/Documentum/XML%20Applications/joesdev/goodnews/book.dtd"/> <myBook>cool book</myBook> Does anyone have any ideas? Thanks!! ...

Parsing a WSDL to extract Service / Port elements

I want to automatically process a WSDL file to discover defined Service / Port elements. Is this possible, using Java or some sort of Ant utility? If so, how? ...

how do I generate an xml file and allow the user to save it locally using javascript?

I am generating a XMl document via JavaScript and need to prompt the user to save it to their local machine. This is the code I have at the moment: var xmlWindow = window.open("", ""); xmlWindow.document.write("<node>data</node>"); This writes the xml to a new window which the user can then hit file->save to download. Is there an...

Parsing XML with AS3

Here is my entire Script as I can't seem to figure out where the problem is. The symptoms are that where I addChild(book) , is not the appropriate place for this to be added properly and sequentially with the thumbs as well. As a result, and to my surprise, the only way I can get these to appear so far is by writing a faulty trace state...

How do I use PowerShell to Validate XML files against an XSD?

As a part of my development I'd like to be able to validate an entire folder's worth of XML files against a single XSD file. A PowerShell function seems like a good candidate for this as I can then just pipe a list of files to it like so: dir *.xml | Validate-Xml -Schema .\MySchema.xsd I've considered porting C# code from the Validati...

Best way to document WCF interface?

So I'm using WCF, and want to document my interface(s) and services to give to another company for an internal app. What's the best way to document those interfaces? I'd prefer having the documentation inline with the code, and then have something prettify to output HTML, but am not sure if there's a recommended way to do it. Thanks....

What is excatly the technology stack defining Web APIs?

What are the abstract levels of technology that are used to build a Web APIs such as GData? ...

Query xml from ASP without XSL

I have some very simple XML: <properties> <property> <name>BobFish</name> <explaination>Bob is a fish.</explaination> </property> <property> <name>DaveFish</name> <explaination>Dave is a fish.</explaination> </property> I want to query if from ASP. Something like: Response.Write (GetExplaination("BobFish")) This is the functi...

Are there any reasons to use SGML instead of XML?

As I understand it, XML is a subset of SGML conceived to simplify it and encourage a more widespread usage. I guess most useful features was brought into XML, but are there any features in SGML powerful enough to motivate using it instead of XML (and accepting the overhead in complexity)? ...

Data is invalid error when loading XML

I am trying to load a very basic XML document but everytime I get to the LoadXml(string url) line, the program crashes and reports an exception ("Data at the root level is invalid. Line 1, position 1" XmlException). XmlDocument xmldoc = new XmlDocument(); xmldoc.LoadXml(@"C:\Websites\TestHarness\TestHarness\TestHarness\ExampleXml.xml")...

XML: attributes or children?

In XSD, SOAP and other XML conventions you'll often see things like: <book> <title>Harry Potter</title> <author>J.K. Rowling</author> </book> Now I'm wondering, what happened to attributes? To me it makes more sense to write this as: <book title="Harry Potter" author="J.K. Rowling" /> But apparently, for some reason, smarter peop...