xml

XML using EJB 2.0

I have a real time database which stores details of trouble tickets.I need to retrieve this information and build a dynamic XML based on it.Is it possible using EJB 2.0.? ...

Xml schema to separate 'data' from 'preferences'

I'm designing an XML document to store some data, that can also have some settings/customisation on it set by a user. I'd like to keep the data stuff that the system defines separate from the customisation by the user. Apalling example: <example> <data> <fruit name="apple" maxCount="20" /> </data> <settings> <fruit name=...

Xml schema issue - cannot work out how to use key!

I'm trying to make up an xml schema for the following: <tagSet> <Structure> <tag> <name>Steve</name> </tag> <tag> <name>Bob</name> </tag> <tag> <name>Steve</name> </tag> </Structure> </tagSet> I would like my schema to complain that Steve is there twice, but I can't get it to work. I have...

encode xml while printing SOAPMessage

Hi, I have written a function to pretty print a javax.xml.soap.SOAPMessage to a string: public static String soapMessageToString (SOAPMessage msg) { try { Writer out = new StringWriter(); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = t...

Cannot find the declaration of element 'assignments'

So I am beginning with XML and Schemas and I ran across this today and I have not been able to figure it out. I am getting and error that says, Ln 5 Col 2 : Cannot find the declaration of element 'assignments'. I believe I have declared the element, but perhaps I am missing something and have not. This is my XML file: <?xml ve...

Source of ISO data in xml format?

Hi All, I was just wondering if anyone knew of a source of standard ISO data in xml format, such as ISO 3166 (Country codes/names), ISO 4217 (Currency Codes) or ISO 639 (Languages)? If it was in any way 'official' and maintained with any changes to the standards that would be great! Thanks, S UPDATE: I can't use files with non-comm...

xpath query in c# throwing exception

I am trying to extract information from the following xml: ezb XmlDocument doc = new XmlDocument(); doc.Load("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"); var x = doc.SelectSingleNode("//@time"); labelDate.Text= "Data From: " + x.Value; works just fine! what does not work however and as far as I can tell the xpath-s...

Get element text from xml doc

Hi, I'm trying to extract some information from an online xml weather resource (weather underground). I am able to open the resource and pull out the desired elements, but what I really want is to return the element text as a variable, without the containing xml element tags, so I can manipulate it and display it on a web page. Perhap...

Validating input and returning errors with PHP and XML

I have a form with several input fields, i would like to go through and check to make sure they are all present before continuing. This is the code i am using if(isset($_POST['url'])){ $url = $_POST['url']; } else { echo "<error>no url</error></data></xml>"; exit(); } if(isset($_POST['username'])){ $username = $_POST['username']; } els...

Java XML Parsing

I could use some guidance on the following problem. The whole "No use of XML libraries is allowed" part is throwing me for a loop. Thanks! Create a java program that takes XML as input, parses the input and writes all the element names to the console indented with tabs to their nesting level. You should handle xml attributes, but you d...

Simple scraping of youtube xml to get a Python list of videos

I have an xml feed, say: http://gdata.youtube.com/feeds/api/videos/-/bass/fishing/ I want to get the list of hrefs for the videos: ['http://www.youtube.com/watch?v=aJvVkBcbFFY', 'ht....', ... ] ...

Why doesn't XML::Twig call my end_tag_handler?

I try to call subroutine for each tag, but the end_tag_handlers is never invoked. My aim is a this sequence: ---sequence--- when <auto> call \&loading. when <apps><title> call \&kicks. when <apps><logs> call \&bye. when <apps> call \&app. when <apps><title> call \&kicks. when <apps><logs> call \&bye. when <apps> call \&app. when </au...

XML Element and Namespace

I have the following method to parse XMLElements: DisplayMessages(XElement root) { var items = root.Descendants("Item"); foreach (var item in items) { var name = item.Element("Name"); .... } } In debug mode, I can see the root as XML like this: <ItemInfoList> <ItemInfo> <Item> <a:Name>item 1</a:Name> ...

Matching only one of many unknown nodes with xpath

Hello. Im trying to match only one of each node with a generic match. Can this be done generic at all? I would have prefered to just match one of each node with the same local-name() <xsl:variable name="xmltree"> <node /> <anothernode /> <node /> <anothernode /> <unknown /> <anothernode /> <node /> <unknown /> </xsl:var...

How to post XML to an iframe with JavaScript

Basically I want to post XML (with Content-Type text/xml) to an URL and display the output directly in the browser. This has to be done in an iframe. Is it possible to post the XML to an iframe? In other words, can the Content-Type of the Post-Request be changed to text/xml? PHP4 is also available if necessary. The URL of the iframe-a...

XML data storage database? free and opensource

I need a way to store data inside xml files and write to differant parts of the file, as well as add elements and structure to the xml document. I need full control over the file names and xml documents, and it would be much easier if I could use some kind of SQL layer to read and write from the xml. Just due to project constraints I...

How to parse an XML tree with DOMDocument ?

Hi, Here is my XML file : <?xml version="1.0" encoding="utf-8"?> <root> <category> <name>Category</name> <desc>Category</desc> <category> <name>Subcategory</name> <desc>Sub-category</desc> <category> <name>Subcategory</name> <des...

Can flash read child XML from the embed tag?

Say I have an flash object embedded in XHTML like so... <object width="600" height="400"> <param name="movie" value="somefilename.swf"> <param name="data" value="somefilename.xml"> <embed src="somefilename.swf" width="600" height="400"> </embed> </object> I know that there are methods to read, parse, and use the data in "somfilename.x...

Mapping a class and xml file using serialization

If I create a class in C#, how can I serialize/deserialize it to a file? Is this somethat that can be done using built in functionality or is it custom code? ...

Storedprocedure returns xml but linq replaces ' " ' with '\'

Hi, I have a stored procedure in sql server that returns xml. The problem I'm facing is that the returned result which is of type ISingleResult contains the string for the xml returned by the stored procedure and in this string all the ' " ' are replaced by '\'. So I can't parse the xml. Why is this happening? ...