xml

MD5 implementation in C for a XML file

Hi, I need to implement the MD5 checksum to verify a MD5 checksum in a XML file including all XML tags and which has received from our client. The length of the received MD5 checksum is 32 byte hexadecimal digits. We need set MD5 Checksum field should be 0 in received XML file prior to checksum calculation and we have to indepandantly...

How to get the next text of an XML node, with C# ?

Hello, I have the following XML. Given the classname, I need to get its corresponding colorcode. How can I accomplish this in C# ? Otherwise said, I have to get to a specific node, given its previous node's text. Thank you very much <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <?xml-stylesheet type='text/xsl' href='templ...

XercesDOMParser and XIncludes

I am attempting to get xincludes working in an existing system that uses a XercesDOMParser in xercesc to parse incoming xml from a client. I am working with Apache Xercesc v3.0.1, and the incoming XML, read from an input stream, is: <?xml version="1.0" encoding="UTF-8"?> <VisionServer xmlns:xi="http://www.w3.org/2001/XInclude"&gt; ...

LINQ to XML error: Object reference not set to an instance of an object

I am trying to grab some role information, the first node however does not have an element "projectRoleType" I want to skip over that one and only grab the ones that have a "projectRoleType" and "categoryId". Every way I try to check I always get the error: Object reference not set to an instance of an object. What am I not doing? var...

How do I use Convert.ChangeType to cast to a specific class?

Hello, Does anyone know how I can use Convert.ChangeType to cast from XML to a specific class? For example: My Property public Point Loc { get { return GetValue<Point2D>("Loc"); } set { SetValue<Point2D>("Loc", value); } } My XML: <Loc> <X>1.0</X> <Y>1.0</Y> </Loc> Call to convert: prop.SetValue(targetObj, ...

How to set a variable attribute of an xml element in actionscript 3?

Something that should be very easy has been the quest of my day. How do you set a variable attribute of a xml element? This is what I expected to work: xmlElement.attribute(variableAttr) = "the variable attribute is set to this string"; However, I'm getting some error that this value can only be retrieved as a reference and not set....

Creating elements with simple content and attributes

hi If we want to create an element containing both simple content ( thus one of the build-in datatypes ) and attributes, then instead of using <simpleType> element, we instead must declare complex type and specify that this complex type will contain simple content. We do this by using <extension> element under the <simpleContent> elemen...

Which Perl XML parser can add data to particular nodes?

I need to add a few lines in an XML file at a particular node, in Perl. So, I need to search for a particular node and then add those lines. Which parser would you recommend for this? ...

how to find restriction values in a simple xsd element with c#

How can I retrieve these enumeration types on an xsd simpleType with c#? Here is a sample simple type? <xs:simpleType name="PaymentType"> <xs:restriction base="xs:string"> <xs:enumeration value="Cash" /> <xs:enumeration value="CreditCard" /> </xs:restriction> </xs:simpleType> thank you ...

Problem loading remote html source code using JDOM

I am trying to use JDOM to load the source code of a remote HTML file (a Blogger's profile). I have this code: public Document getDoc(URL url) throws JDOMException, IOException{ SAXBuilder saxBuilder = new SAXBuilder(); saxBuilder.setFeature("http://xml.org/sax/features/validation", false); saxBuilder.setFeature("http://apac...

help parse this data using jquery's xml parsing

I am having trouble parsing specific data using jquery. I have tried a few tutorials and samples online but I don't seem to have any luck with the way my data is formatted. If I have xml data as follows: <links total="2"> <link id="1"> <title>whatwhat</title> <url>http://google.com&lt;/url&gt; <img>1c9a871e2...

jQuery: Evaluate script in ajax response

XML responses from my webapp have both HTML to add to the page AND some have a script to run. I'm trying to send back XML from my webapp like: <?xml version="1.0"?> <doc> <html-to-insert> <![CDATA[<p>add me to the page</p>]]> </html-to-insert> <script> <![CDATA[ alert('execute me'); ]]> </script> </doc> What I'm doin...

How to group elements by attribute values using XQuery on SQL Server?

Let's say I have a table in SQL Server which contains the results of a query with an inner join. The following XQuery: select @code.query ( 'for $s in /root/row return <Foo Language="{data($s/@lang)}" Method="{data($s/@method)}" Returns="{data($s/@returnType)}"> <Bar ReferencedBy="{data($s/@callers)}" Static="{data($s/@static)}" /> </...

Encoding xml using ascii encoding instead of character entities

Alright, so here is my issue. I need to generate xml in Java to pass onto another application. I started off thinking this would be easy using an org.w3c.dom.Document. Unfortunately the application I need to pass the XML off to requires that special characters like " need to be encoded as ASCII (&#034;) instead of their character entity ...

ASP.NET C# Search XML Node on multiple criteria

I am trying to search for an xml node: <Countries> <Country FullName="AFRIQUE DU SUD" Code="ZA" IsOut="1" /> <Country FullName="ALLEMAGNE" Code="DE" IsOut="0" /> </Countries> Selecting on the basis of CountryCode only: xmlDoc.SelectSingleNode("//Countries/Country/@[Code='ZA']"); How do I also apply the condition so that I can c...

Parsing ATOM feed in Dojo?

I am trying to parse an ATOM feed and display the relevant parts I need. After doing some searching, I couldn't find a way to do this in Dojo, so I wrote this implementation to get by in the meantime (var xml contains the atom feed): var names = this.getArray(xml.getElementsByTagName("name")); var contents = this.getArray(xml.getElement...

XML as a database

I've been reading about XML, XSL, XPath, etc. I want to start this small script in PHP using XML as the database to create a simple CRUD app. I will be using SimpleXML but after reading some answers over stackoverflow it seems many people suggest DOMDocument (is there anything that benefits using DOMDocument more than SimpleXML?) Anywa...

Two errors when using PHP XMLreader

I have the following two errors when using XMLReader. 1) Warning: XMLReader::read() [xmlreader.read]: MyXML.xml:43102: parser error : xmlParseEntityRef: no name 2) Warning: XMLReader::read() [xmlreader.read]: ^ in MyXMLReader.php on line 56 Does anyone know what those refer to? My PHP Code (The XML file is about 100MB so I can't inc...

Parse then Store XML Data from API in Ruby on Rails

Hello All, I know there have been a ton of entries about this topic but I haven't seen the complete picture yet of how to store the data. I am trying to make a system that reads then parses then stores information about events from the Yahoo Upcoming API. The url returns a pretty simple xml that looks like this <event> <id>489875230<...

How do I select something with a blank namespace with Jaxen?

I have the following xml: <config xmlns="http://www.someurl.com"&gt; <product> <brand> <content /> </brand> </product> </config> I'm reading it nicely into JDOM. However, when I try to use Jaxen to grab the contents, I can't seem to get anything. Here's an example of what doesn't seem to work: XPath xpath = new JD...