xml

What is the difference between JAXP and JAXB?

What is the difference between JAXP and JAXB. ...

Store Business Rules in XML Document, Validate afterwards in Java, how?

Example XML Rules document: <user> <username> <not-null/> <capitals value="false"/> <max-length value="15"/> </username> <email> <not-null/> <isEmail/> <max-length value="40"/> </email> </user> How do I implement this? I'm starting from scratch, what I currently have is a User-class, and a UserCon...

How to access a subset of XML data in Java when the XML data is too large to fit in memory?

What I would really like is a streaming API that works sort of like StAX, and sort of like DOM/JDom. It would be streaming in the sense that it would be very lazy and not read things in until needed. It would also be streaming in the sense that it would read everything forwards (but not backwards). Here's what code that used such an AP...

How to use for loop in xslt

Dear all, How to use for loop in xslt to get value iteratively from an xml file and to dispaly it in table fromat for example: the xml file is like <order> <item name ="a"/> <item name ="b"/> <item name ="c"/> <item name ="d"/> <item name ="e"/> <item name ="f"/> <item name ="g"/> </order> and the output should be ...

In php, Prepare string and create XML/RSS Feed

I want to create my own RSS/XML feed. I fetch data from the database to display, but keep getting invalid character errors. If the string has an ampersand or other strange characters in it, the XML will be invalid. I tried using urlencode and htmlentities, but these don't capture all possible characters which need to be escaped. Does...

PHP: How to get <br/> working in a simplexml_load_file() var.

Hi everybody! I am loading an xml in php via simplexml_load_file(). I load the file with that: $xml = simplexml_load_file('flash/datas/datas.xml'); And the access my content like that: $descText = $xml->aboutModule->chocolaterie->desc The text from desc is well registred in my $descText, but all the <br/> of the text disappear....

add namespace + prefix to XML using XSL

Hi, I hope you can help... Let's assume I have following XML: <data> <token> <sessionId>12345</sessionId> <userId>john</userId> <moreInfo> <bla> ..... </bla> </moreInfo> </token> </data> And I need this to become <login:data xmlns:login="http://my.ns.uri"&gt; <login:to...

Why is this not a valid XML DTD? (Parameter entity and #PCDATA)

Hi, Using the DTD validator here, I am informed that the following DTD is invalid. <!ENTITY % text "(#PCDATA|L)*"> <!ELEMENT H (%text;)+> <!ELEMENT L (#PCDATA)> The error message is: "A '(' character or an element type is required within declaration of element type "H"." at line 2, column 22. Can anyone please point ...

How to process XML sernt via POST?

I'm receiving XML sent via POST. Naturally I need to parse this XML to get at the goodies it holds for me. However, when I receive the XML is seems that PHP is parsing it like a query string. For example, this xml: <?xml version="1.0" encoding="utf-8"?> <ForgotPassword> <version>1.0</version> <authentication> <login>my...

Scala XML retrieving from optional paths

I'd like to process a document to retrieve a value that could have more than one path. The ideal signature would look something like: def value(doc: Elem, potential_paths: List[something]): String Where it would simply process the doc looking at the head of the potential_paths, if found, return it, otherwise continue with potential_p...

Duplicate XML namespaces in .NET generated SOAP messages

Is there a way to automatically remove duplicate XML namespaces from messages generated by the WCF? It seems half of the message consists of duplicate namespaces. Here is an example generated by WCF: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; <s:Header /> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-...

How can I get a Node adjacent to a unique Node using Scala?

I'm trying to parse an Apple plist file and I need to get an array Node within it. Unfortunately its only unique identifier is sibling Node right before it, <key>ProvisionedDevices</key>. Right now my best thoughts are to use Java's XPATH querying or Node.indexOf. Here is an example: <plist version="1.0"> <dict> <...

AS3: doesn't read Atom

Hey, I want to read an Atom in Flex. I can see in the debugger that he can read the Atom and that there are entries, I can see each value. So far, so good. But when I want to assign a value from the atom to a variable, he never gives any text. It's always this: "". My code: ch.Name = xml.title; ch.Desc = xml.subtitle; ch.Updated = xm...

Can resources be extracted from a compiled iPhone app? If yes, how can they be secured?

Can resources be extracted from a compiled iPhone app that is released to the iTunes store? I'm particularly interested in the security of XML files... if I have copyrighted data in an XML document in my resource directory, how likely is it for someone to extract that information and paste it around the internet? If it's as easy as usi...

Performance problems in apache server with php

Hi all. I think I have a performance problem in my apache server. I have apache server on solaris 10 with php and some flash client applications. The clients get data from server in XML formation with HTTPService requests. sometimes the data doesn't arrive and sometimes it does. maybe performance in the apache server or in the php (maybe...

Secure xml messages being read from database into app.

I have an app that reads xml from a database using NHibernate Dal. The dal calls stored procedures to read and encapsulate the data from the schema into an xml message, wrap it up to a message and enqueue it on an internal queue for processing. I would to secure the channel from the database reads to the dequeue action. What would be ...

Outputting a DOM to HTML with &'s

I am trying to output a DOM that contains elements such as &nbsp; to an html file, but it will show &amp;nbsp; in the output, which is obviously not desirable. My code is as follows Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.METHOD, "html"); Result re...

Converting output of sql query

Hi, Let say I have table Payments Id int autoincement Status int and my query is : select id, status from payments but I wanna convert status to enum. 0 is unpaid 1 is paid. so result should look like: 1 paid 2 unpaid 3 paid ... I need this conversion because I use XmlReader reader = cmd.ExecuteXmlReader(); oc.LoadXml("<r...

Contract first WSDL with IDREF not generating corresponding @XmlIDREF annotation

I am developing a web service contract first, and I wish to use XML object graphs (ID, IDREF) to eliminate redundant data. So, I have a situation where I have a complexType which has an xsd:ID attribute, and another one referring to it through xsd:IDREF. I also included the jaxb:baseType with the name of the complexType so that the clas...

Where to get the Google Search XSD

we are developing an Google search component for our website. We are getting the result from Google in the form of XML. Where Can I find the XSD for Google search results? ...