xml

C# parse XML Schema (SimpleType) question

Dear All, Good day. I can handle a ComplexType such as: <xsd:element name="Prerequisite"> <xsd:complexType> <xsd:sequence> <xsd:element name="Type" type="Prerequisite.Type.type" minOccurs="1" maxOccurs="1" /> <xsd:element name="Miscellaneous" type="Prerequisite.Misc.type" minOccurs="0" maxOccurs="1" /> ...

XSD: How to validate the XML file according to value of some tag ?

Hi! I was trying to validate this XML file ... where if <tag1> is "Y" then <tag2> must appear if <tag1> is "N" then <tag2> must not appear .. <parent> <a> <tag1>Y</tag1> <tag2>sometext</tag2> </a> <a> <tag1>N</tag1> </a> </parent> I tried <choice> tag but doesn't seem to work .. :( I have come to conclusion th...

How can I get the xml Node type based on schema definition in Java?

Let's say I have a doc.xml and corresponding doc.xsd. I use xpath to retrieve some nodes, so I get a list of org.w3c.dom.Node. How can I get type of each node from schema, eg. xs:integer, xs:string etc ? Some solution would be to parse schema with xpath query "//NodeName[@type]" using node.getNodeName() as NodeName, but that's not perfe...

cURL sending XML incorrectly when using tag attributes

Scenario: Sending XML, generated using php, via cURL to an external server for parsing. Problem: The XML contains tag attributes which cause problems when being sent using cURL Code: $generated_xml = -- NOTE: NOT THE SYNTAX USED IN THE CODE, SPLIT FOR EASE OF READING -- "<xconnect> <report> <id>contact_get</id> <in...

What is a good templating engine?

What is a nice templating engine to use in C#? I have XML or JSON as structured datasource. This data needs to be presented to users on the web in strict XHTML. I've been using XSLT mostly, but maybe there are more or better options? It needs to be used in C# or IronPython. ...

C# Special Characters not displayed propely in XML

Hi..i have a string that contains special character like (trademark sign etc). This string is set as an XML node value. But the special character is not rendered properly in XML, shows ??. This is how im using it. String str=xxxx; //special character string XmlNode node = new XmlNode(); node.InnerText = xxxx; I tried HttpUtility.html...

Avoid exception on XML selectSingleNode function

Hi, i have the following question: I have a XML file with some elements that are the response of the invocation of some webservice. The problem is that i need to load that XML file and select a specific node, but, if the websevice returns a response where the element i'm trying to extract not exist, my function SelectSingleNode will fail...

How can I make the 'return character' for a text with several lines in an xml tag, which I parse then put in a UItableView?

I want to display in a UItableViewCell, text like line1 line2 I get it from an xml tag like line1 line2 I've tried a lot of things, like: <br/> (also &lt;br&gt;), \n which only displays "line1 \n line2", <![CDATA[<br >]]> which only displays "line1 <br> line2". Thanks for the help ...

Embedd a xsd file in C#

Hi Right now we have static code to a XML schema file. But now we want to embedd that file Code right now: XmlTextReader reader = new XmlTextReader("schema.xsd"); XmlSchema schema = XMLSchema.Read(xReader, new ValidationEventHandler(ValidationEventHandler)); But now I want to have it embedded in a Resouce file. So how do I do. XmlT...

Parse a nested xml with PHP to an object

Hi All, I have to parse an xml file with PHP to an object. At the moment I don't have a clue how to do this, help is appreciated. The xml is quite big. I have to parse a part of it which looks like this: <someNamespace:xmlDocument> <someNamespace:categories> <category name="Patrick" anAttribute="numericValue" anotherAttribute="numeri...

How to deserialize XML with multiple nested items?

I have given XML that I can't change and I need to deserialize it to a custom class: <Person> <Addresses> <MainAddress> <Country /> <City /> </MainAddress> <AdditionalAddress> <Country /> <City /> </AdditionalAddress> <AdditionalAddress> <Country /> ...

which is the better XML viewer/editor where I can get XPath of nodes .. (to copy them to xsl file)

Being an XSLT designer, I am finding it hard to type XPath of nodes manually ... is there any editor or xml viewer which can give me Xpath of the nodes so that I can copy paste them :) thanx in advance ...

Is there a tool to automatically replace a bunch of GUIDs with dynamically-generated ones?

I'm not a developer. I need to hack an XML file to duplicate hundreds of resources that are each assigned a GUID. Is there a way to parse the entire file, replacing each GUID found in a tag with a dynamically generated one? Basically - every UniqueID tag (but not the ContentUniqueID tags) needs a new GUID. <root xmlns:xsi='http://ww...

WPF and WCF User Configurable Fields

Hi I have a requirement whereby a user can specify a variable number of user-defined fields, for example in an xml file. These fields have a user-friendly name which is displayed in the GUI, and a code which is used to persist and retrieve the value of the field to the database. The problem is that I need both my WCF service to consum...

How do I get schema information for a node in a XmlDocument?

Having a XmlDocument loaded with a XSD schema, how do I get the restrictions for a given node in the document? I would like to iterate through the document, and automatically correct errors where possible (eg: truncate strings that are too long, remove empty nodes that shouldn't be, etc.) I am doing this because xsd.exe does not take i...

XML parsing iPhone

Hi Guys, I am having this string: [?xml version="1.0" encoding="UTF-8"?] SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:methods" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:PingdomAPI" xmlns:SOAP-ENC="http://schemas.x...

Retrieving a subset of XML nodes with PHP

Using PHP, how do I get an entire subset of nodes from an XML document? I can retrieve something like: <?xml version="1.0" encoding="utf-8"?> <people> <certain> <name>Jane Doe</name> <age>21</age> </certain> <certain> <certain> <name>John Smith</name> <age>34</age> </certain> </people> But what if I only want...

Generate DB schema and load data based on XML file?

We have a large XML file with lots of data relationships and lots of data. Is there a way to generate a DB schema based on the relationships and then load the data into the schema? ...

Read XML in Actionscript 1.0

I need to program an interactive app running on Flash Media Interactive Server, which only supports Actionscript 1.0. This particular app needs to read remote data from a remote webservice. Is there any way to load remotely generated XML in Actionscript 1.0? The only closest solution I've found on the net uses the LoadVar class, which do...

.Net WCF - Receiving & Sending XML

I'm new to WCF I have to create a WCF service that receives plain XML (not SOAP), does some processing then sends a reply message back in plain XML. I don't have a problem sending XML, I just need some tips on where to start. I'm familiar with creating web services in .Net with SOAP... with web services I would define the function to be...