xml

billion laughs - DoS attack

<!DOCTYPE root [ <!ENTITY ha "Ha !"> <!ENTITY ha2 "&ha; &ha;"> <!ENTITY ha3 "&ha2; &ha2;"> <!ENTITY ha4 "&ha3; &ha3;"> <!ENTITY ha5 "&ha4; &ha4;"> ... <!ENTITY ha128 "&ha127; &ha127;"> ]> <root>&ha128;</root> supposedly this is called a billion laughs DoS attack. does anyone know how it works? ...

XPath results from XSLT are incorrect - not going through entire XML

Hi! So I have a really confusing problem on my hands.. It seems as though that the entire XML data hierarchy is not being searched through when using an XPath expression in XSL. Some dummy XML data: <pets name="myPets" NUM="2"> <dog name="allMyDogs" NUM="5"> <dog name="Frank" NUM="3"/> <dog name="Spot" NUM="4"/...

Append to an existing groovy.util.Node with groovy.xml.MarkupBuilder syntax?

I'm working with an API that returns a groovy.util.Node, allowing me to customize its generated XML. I need to append a child element into the Node, and I'm wondering if I can use MarkupBuilder syntax to modify the Node. For example, here's something that works, but seems klunky: withXml { rootNode -> def appendedNode = new Node...

Best practice for securing username/password between clients and server

Howdy, Got an application (C# WPF) that needs to "call home" and get updated stuff from a home server. In theory there could be thousands of client out there, needing to communicate over the public internet. Each user will first register with a username and a password. Then, as the application runs, it will call home every now and then...

How to style XML displayed in HTML?

I'd like to display XML pulled from a database on a website. I'd like to be able to style how it is displayed (such as different colors for string value, attributes, elements,..). How would you do this? Can you use CSS? Thanks! EDIT: I mean display the XML as XML editor would, sorry for the confusion! ...

onListItemClick() not working for ListView in Android

The following will not register the Toast upon clicking. In fact, it doesn't even seem to detect a click. The parent class that CustomListTitle extends is ListActivity, so everything should be set, but it's not working. No errors, just no registering a click. package com.mtp; import android.app.Activity; import android.app.ListActivity...

How to persist application model

My c# application needs to persist its model classes to disk. Initially I tried to do xml serialization. However when I do breaking changes in my model (split one class to two) the saved xml will not deserialize (which is understood). I thought about applying xslt to upgrade the xml but the xml generated is really complex. Is it a good...

Select element where attribute = "X"

I have the following XML <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="example3.xsl"?> <pics> <page no="1"> <pic> <td> <no src="http://www.templetons.com/brad/pq/playaphone.jpg" width="150" height="120">1</no> </td> </pic> <pic> <td> ...

Help with SQl Server and XML?

I issued a query request to sql server with "FOR XML AUTO, type, elements, root('root')" appended to the end of my query. I issue a da.Fill(ds) [to a datset] which works without any problems. Now that I have the data, I want to transform it into HTML. So I used: Dim XMLString As String = ds.GetXml() that converts my data into a str...

xslt parent element position

Hi I have the following xml to be transformed. But I don't how to get the primary driver tag value in the transformed xml. Primary driver should be based on the driver nodes position. Can somebody help me? <drivers> <driver> <first_name>Doug</first_name> <last_name>Harry</last_name> <vehicles> <vehicle> ...

xslt regular expressions to match xml entries and display

I know it is so simple to some of you. All I want to do is look through an xml doc and print out the xml entries that contain specific string fragments. The string value is passed to the xslt and the xml doc is looked at and if a word begins with the string expression it displays it. What I have errors with the following message... ...

Pass href dynamically in an XML file

How can I dynamically specify the href value in the line <?xml-stylesheet type="text/xsl" href="first.xsl"?> in an xml? I would like to substitute "first.xsl" dynamically. Thanks for your help. ================== Apologies for messing this up/making it difficult for you to help ==== My XML is: <?xml version="1.0" encoding="utf-8"...

XPath query to parse xml properties file

I have the following xml document: <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"&gt; <properties> <comment>My Happy Configuration</comment> <entry key="HappyKey">Happy Key</entry> <entry key="SadKey">Sad Key</entry> <entry key="AngryKey">Angry Key</entry> <entry key="ConfusedKey">Co...

Need help preforming an XSL Transform from XML to HTML in ASP.NET MVC

I just learned about XSL and XSLT a few days ago and now I'm trying to put it to work based on a question I had earlier today (want to have formated XML displayed on my website). Here is the code I'm trying (in a View): XDocument xmlInput = XDocument.Parse(item.Action); XDocument htmlOutput = new XDocument(); using (System.Xml.XmlWrit...

PHP: How can I access this XML entity when its name contains a reserved word?

Hi all. I'm trying to parse this feed: http://musicbrainz.org/ws/1/artist/c0b2500e-0cef-4130-869d-732b23ed9df5?type=xml&amp;inc=url-rels I want to grab the URLs inside the 'relation-list' tag. I've tried fetching the URL with PHP using simplexml_load_file(), but I can't access it using $feed->artist->relation-list as PHP interprets "l...

How to calculate the XPath position of an element using Javascript?

Let's say I have a large HTML file with different kinds of tags, similar to the StackOverflow one you're looking at right now. Now let's say you click an element on the page, what would the Javascript function look like that calculates the most basic XPath that refers to that specific element? I know there are an infinite ways of refer...

How to render XML data in a nice table?

When Google Analytics return data, it is in XML: (this is just for the data of IE. there is also data for Firefox, Safari, etc, for the pageview counts) <entry gd:etag='W/&quot;AkMEQX47eSp7I2A9Wx5SE3Z.&quot;' gd:kind='analytics#datarow'> <id>http://www.google.com/analytics/feeds/data?ids=ga:1234567&amp;amp;ga:browser=I...

How do I use Elastic MapReduce to run an XSLT transformation on millions of small S3 xml files?

More specifically, is there a somewhat easy streaming solution? ...

how to specify at least one in a xsd:sequence

I have a sequence <xs:element name="XXXX"> <xs:complexType> <xs:sequence> <xs:element ref="YY" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="ZZ" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> but I would like that at least one element of YY or ZZ to be present, in ...

linq to xml CDATA problem

When I used linq to retrieve xml, <CDATA[[ ]]> is removed, which is what I want to achieve. But when I save the file, <CDATA[[ ]]> becomes &lt;CDATA[[ ]]&gt; in the xml file. Whether or not I explicitly append with <CDATA[[ ]]> before saving gives me the same result. Tried appending with &lt;CDATA[[ ]]&gt; but still gives me th...