xml

Web.xml: Are url-pattern tags relative to each other?

<servlet-mapping> <servlet-name>myName</servlet-name> <url-pattern>/aName</url-pattern> </servlet-mapping> <security-constraint> <web-resource-collection> ... <url-pattern> /* </url-pattern> </web-res...

how to transform xml with xslt preserving <br /> and not preserve other tags in a text

This question is quite similar to this one. Except that I want to preserve only <br /> and some <img> tags (with class="visible"). I.e from: <example> <text> Some text with <br /> and <img src="source" /> then text .... <img class="visible" src="source" /> </text> </example> To have: <div class="example"> <p>Some text...

XML jquery shortcuts

I am writing a bit of code that appends my site nav with and extra ul that gives a description about where that link takes you. I need to use our CMS's built in Nav structure so appending via jQuery was the best solution, and XML makes the data easier to manage. My question is this: is there a more efficient way to write out the js? What...

Soundcloud API, PHP, and OAuth

Hi guys. I'm building a site, and I need to query my last two tracks from my soundcloud account and display them on my page. I've read the Soundcloud API documentation but it seems obscure and far from my reach. I've installed the PHP library for using the API and Oauth, and set up my SoundCloud application to get my Consumer Keys, but I...

How can I extract and save values from an XML file in Perl?

Here is what I am trying to do in a Perl script: $data=""; sub loadXMLConfig() { $filename="somexml.xml" $data = $xml->XMLin($filename); } sub GetVariable() { ($FriendlyName) = @_; switch($FriendlyName) { case "My Friendly Name" {print $data->{my_xml_tag_name}} .... .... ......

Parse Exception: At line 1, column 0: no element found

Hi everyone, I have a weird issue. I receive the following error that causes a force-close: org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: no element found at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:508) at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:467) ...

ISO-8859-1 and MacRoman Encoding

I've got a MySQL database table with an ISO-8859-1 encoded text field containing user names. When I export that to a text file using PHP I get a normal text file saved on the client computer. When I open it in Word or Excel on a Windows system, it looks good. When I open it on Mac using Word or Excel, the high-ascii characters are wro...

JUnit Test if XML Document is sorted on arbitrary column

Given an xml document like <root> <row> <a>2</a> <b>1</b> <c>8</c> </row> <row> <b>5</b> <a>2</a> <c>8</c> </row> <row> <a>2</a> <c>8</c> <b>6</b> </row> </root> Is there an easy way to assert that the XML document is sorted on element B in XMLUnit Edit: I have an odd problem with a pie...

jQuery - xpath find?

If you have the xml below in $(xml), you would get droopy using: $(xml).find("animal").find("dog").find("beagle").text() Is there an equivalent way in jQuery to use xpath like $(xml).xpathfind("/animal/dog/beagle").text()? <animal> <dog> <beagle> droopy </beagle> ... ...

XML Schema to Java Classes with XJC

I am using xjc to generate Java classes from the XML schema and the following is an excerpt of the XSD. <xs:element name="NameInfo"> <xs:complexType> <xs:sequence> <xs:choice> <xs:element ref="UnstructuredName"/> <!-- This line --> <xs:sequence> <xs:element ref="StructuredName"/> <xs:eleme...

possible to recreate xml out of ActionScript?

Hi, I got stuck with an SWF which has ActionScript in it and should use some xml. The problem is, I cannot edit the SWF by decompiling it and compile it again, it simply doesn't work... Adobe Flash CS4 rebuilds the thing, but after I press CTRL+ENTER I get a lot of runtime errors (probably something to do with AS <-> AS2 <-> AS3 and don...

Python: How to extract xml embedded in a html file?

I have a html file with xml snipped embedded, the source code is pasted in the pastbin: http://pastebin.com/Hy0QaWk8 my task is to extract the text enclosed in the first textarea, which is a xml snippet, from the html. Without any change to the original snippet. I'm able to get it by using the BeautifulSoup, but it changes all the tag ...

Question on Books

I am a learning SQL, HTML now. I would like to learn the following two more... Java, XML. I want to understand these two from testing and Web Services point of view. Is there a better order to learn the next two Java, XML or XML, Java? ...

Java: How to store Vector<String[]> in XML (or save in any other way)

Basically I have a proof-of-concept application that is a digital recipe book. Each Recipe is an object and each object has, among other fields, a Vector containing arrays. The Vector is the list of all ingredients in the Recipe while each ingredient has an array showing the name of the ingredient, the amount, and the unit for that amo...

How can I define Makefile variables from a Perl script?

I am creating a Makefile which I want it to be a single file for different architectures, OSes, libraries, etc. To do this I have a build specific XML file which defines the different configuration options for each architecture. The config file is read by Perl (it could be any language) and the Perl output returns something like: var1...

XML RPC c# Call returns array of strings and int

I'm doing an XML RPC call in ASP.net with c# and the call returns an Array called userinfo with strings and integers in it and I can't seem to figure out how to parse the data and put it into string and int objects... The only thing that compiles is if I make it an Object in the struct. The int returns fines and is referenced easily. An...

XML Parsing Error: not well-formed

I get the above error when viewing a xml document. The problem seems to be the second ( = ) in the following link. http://mysite.com/viewpage.php?u=1020&amp;op=new In the link & is replaced by & amp; without the space. Any help as to why this is throwing an error would be greatly appreciated. This is how the link is added to the ...

What is wrong with this layout? Android

Hi, I am trying to accomplish a view like this: left side = live camera preview, right side = a column of 4 images. But all that I managed with the following xml was a fullscreen live camera preview. Android 1.5 emulator. Thanks <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/a...

XML Deserialization in VB/VBA

I have a set of VBA classes in an MS Access database. I have an xml string with data I want to create new classes with. Other than setting each property individually, is there an easy way to deserialize the XML into my object? I've seen the code using the TypeLib library Public Sub ISerializable_Deserialize(xml As IXMLDOMNode) Dim...

Using Qt's XML library for simple operation

I basically want to use the XML parser from Qt in my existing project. I have only used Qt once before, and that was with Qt Designer, and I am not having much luck finding anything on Google about how to just use the XML library. I have downloaded a web page that has one large list, and I want to parse it and add each list item to a c+...