xml

JAXB - Example of following a keyref when unmarshalling

According to this, you can make use of xs:key and xs:keyref when marshalling and unmarshalling data in JAXB 2.x. However, I can't find a working example of this being done anywhere. What we're doing is setting a lookup section in each XML message containing the details for the reference/code values (id, name, description, etc), and the...

select all matching nodes using xpath and xslt (without additional templates or for-each)

Hi! I have a particular problem that I can't seem to solve. Is it possible to select all nodes using xpath and xslt without the use of additional templates or for-each? Example xml: <aaa id="11"> <aaa id="21"></aaa> <bbb id="22"> <aaa id="31"></aaa> <bbb id="32"></bbb> <ccc id="33"></ccc> <ddd ...

Create Java Pojo dynamically

How can I create Java Pojo at runtime? ASM or BCEL is required for this? I am reading a XML file and I want to generate Pojo according to this xml. ...

Hi, I would like to (de)serialize an object(Hashmap) from an XML of this form with XStream.

XML: JAVA Hashmap: map = {key1=text1,key2=text2} this doesn't work. why? String xml = "<nodes><node id=\"key1\"><![CDATA[text1]]></node><node id="\key2\"><![CDATA[text2]]></node></nodes>"; XStream xs = new XStream(); xs.alias("nodes", Map.class); xs.alias("node", String.class); xs.useAttributeFor("id",String.class); Map<String,St...

I want to create an access database populated with data from xml file

I want to create an Access database('mdb') from an xml file. Creating empty access database is easy(I am able to do this), I am having problem in figuring out how can we create a table and populate it with data from the xml file on the fly through code. I am using C#. ...

Is there any way to do a conditional in a NLog layout?

I'm trying to create a NLog layout config like so: layout = "${callsite} > ${message} (${exception:format=tostring})" The output for this layout is (when I test it): TestProject.Program.Main > exception thrown (System.Exception: exception message) However, if I try to output a message that doesn't have an exception, it shows up ...

Send XML using XMLHttpRequest using GWT

Currently I use the JavaScript code to send XML data in GWT. Is there an easier way to send them? sendRequest.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { // RegisterBuiltin.register(ResteasyProviderFactory.getInstance()); // ItemExtension client = ProxyFactory.crea...

Error while deserializing XML from SQL Server

I have an application which serializes and deserializes .NET objects to XML. While deserializing I am getting the following error: "There is an error in XML Document(1,2) Name cannot begin with the '.' character, hexadecimal value 0x00. Line 1, position 2. " The code snippet that does the deserializing is: string xmlEntity ...

Generate XML document in-memory with JavaScript

I am working on a Web application that needs to send XML to a server backend. I'd like to build a XML document in-memory on the client-side, but using XML manipulation routines, instead of appending countless strings together. I'm hoping jQuery can help me out. Let's say I need to generate this (toy) XML document with JavaScript: <repo...

Parsing an XML file without root in Java

I have this XML file which doesn't have a root node. Other than manually adding a "fake" root element, is there any way I would be able to parse an XML file in Java? Thanks. ...

Advice on using (or not using) XML in a hierarchical object model

I'm developing a hierarchical object model that is self-referencing as a 0/1 --> * relationship. An object without a parentID is a root element. The parentID is also the foreign key on the self-join. From my understanding, using the parentID as a foreign key will only point to a column where child elements may be found --> does this forc...

XALAN register Extension Function like in SAXON

Hi, i want to transform a XML by XSLT with XALAN. Now i want to use a extension-function, this function have to be added in JAVA source like in SAXON: Method: TransformerFactory tFactory = TransformerFactory.newInstance(); Configuration c = ((net.sf.saxon.TransformerFactoryImpl) tFactory).getConfiguration(); c.registerExtensionFunctio...

Android ListView that does not scroll?

I'm trying to make a layout that is something similar to how the android market is...where say under comments there is what appears to be a ListView but it does not scroll (the whole page scroll but not the comments). I'm not sure if its even a ListView but I want something that looks like the list view (ie. have those divider bars and w...

how to use more than one xml file at run time in a single php?

i have to use more number of xml files at a single time . i have only one php page. then how to call all xml files in php. if you know the answer please tell me. thanks in advance. ...

Is there a way to implement twitter search?

I would like to implement twitter search, but with the use of their API. I think most of you know the search which they have on their home page. Search gives such link: http://twitter.com/#search?q=ipod ubuntu I looked in API for a possible solution, but didn't find it. Also it would be nice if the response to the request could be in X...

How to insert image in xml on iphone

In my app i insert images in the tableview by putting the url of image in the field image of xml!! It's possible insert the entire image directly in XML, including in the field image, instead of the URL, a kind of image compression, for example, the bits that make up the image. ...

Jquery parsing xml from request

Hi, I am using Jquery. I have an xml returned from a webservice. So I want to extract some value from it. This is an xml example returned from webservice: <ns3:ExecuteResponse xmlns:ns3="http://www.opengis.net/wps/1.0.0" xmlns:ns1="http://www.opengis.net/ows/1.1" xmlns:ns2="http://www.w3.org/1999/xlink" statusLocation="http://webse...

Hyperjaxb3 association problem

Hi all, I want Hyperjab3 to persist with association like ManyToOne. Here is my example : <xsd:complexType name="Service"> <xsd:sequence> <xsd:element name="id" type="xsd:string" minOccurs="1" maxOccurs="1"> <xsd:annotation> <xsd:appinfo> <hj:id/> </xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:...

remove xmlns attribute from namespace prefix node

Hello everyone, I'm trying to use XSLT to create Edge Side Includes html blocks. Here is a sample XSLT <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:esi="http://www.edge-delivery.org/esi/1.0" exclude-result-prefixes="xsl esi"> <xsl:output me...

How to get every attribute's name, value and parent element name in SQLXML?

Given this SQL: DECLARE @content XML SET @content = '<people> <person id="1" bimble="1"> <firstname bobble="gomble">John</firstname> <surname>Doe</surname> </person> <person id="2" bimble="11"> <firstname bobble="zoom">Mary</firstname> <surname>Jane</surname> </person> <person id="4" bimble="10"> <firstname...