xml

Pros and Cons of programming languages for XML & string manipulation

I don't mean this to be opinionated. What are serious pros/cons of various server-side languages in regards to creating/modifying xml. I'm currently researching new platform/language direction and we deal with a lot of xml. We also do a lot of string manipulation, what advantages/disadvantages do different languages have in regards to...

XML to be validated against multiple xsd schemas

I'm writing the xsd and the code to validate, so I have great control here. I would like to have an upload facility that adds stuff to my application based on an xml file. One part of the xml file should be validated against different schemas based on one of the values in the other part of it. Here's an example to illustrate: <foo> ...

Check for default value of attribute in XPath

Hi, i have XML schema: <xsd:complexType name="contactsType"> <xsd:sequence> <xsd:element name="contact" type="contactType" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="visible" type="xsd:boolean" default="true"/> </xsd:complexType> and i want to find all contacts which have @visible=true, //co...

Java: Ignoring escapes when parsing XML

I'm using a DocumentBuilder to parse XML files. However, the specification for the project requires that within text nodes, strings like &quot; and &lt; be returned literally, and not decoded as characters (" and <). A previous similar question, http://stackoverflow.com/questions/1979785/read-escaped-quote-as-escaped-quote-from-xml, rec...

Fake ASMX Web Service Call

I built a .NET ASMX web service connecting to an SQL Server database. There is a web service call GetAllQuestions(). var myService = new SATService(); var serviceQuestions = myService.GetAllQuestions(); I saved the result of GetAllQuestions to GetAllQuestions.xml in the local application folder Is there any way to fake the web serv...

WCF Deserialization Error

ERROR - Exception: System.ServiceModel.Dispatcher.NetDispatcherFaultException Message: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter services.gmrlive.com/JupiterMobile/2009/01/01/:StatusDetails. The InnerException message was 'There was an error deserial...

Parsing XML in a non-XML column

Hi, i am reasonably proficient with SQLServer, but i'm not a DBA so i'm not sure how to approach this. I have an XML chunk stored in an ntext column. Due to it being a legacy database and the requirements of the project i cannot change the table (yet). This is an example of the data i need to manipulate: <XmlSerializableHashtable xmlns...

Question on XML parsing.

When I am parsing an xml string as below I get strange attributes like "autowire" with value "default". Is there anyway I can get only the attributes that are explicitly defined? <bean id="aaaa" class="com.test.Service"> <property name="cccc" ref="cccc"/> </bean> I am doing simple parsing turning it into a Document and then itera...

how to call a dll file in c. I want to transmit a xml file to it.

I found many ways, but they are too easy, they always get a return-value from the dll file. dll file: a file with the sufix ".dll" ...

Is there a decent alternative to Yahoo Pipes

Pipes is being very buggy lately and has stopped saving new pipes these days. Google Mashup Editor and Microsoft Popfly are both discontinued. Are there are any currently running web apps(or atleast libraries that run on appengine) that do something similar ? ...

Getting 'The argument 1 of the xml data type method "modify" must be a string literal' while inserting a attribute in xml

Trying the following code. But getting 'The argument 1 of the xml data type method "modify" must be a string literal' error. searched alot but cant find any solution for this problem SET @Path = '/@ParentNodeName/@NodeName/child::*' SET @x.modify('insert attribute status {sql:variable("@status")} as first into (' + @Pat...

How to build a database from an XSD schema and import XML data

I have a complex XSD schema and hundreds of XML files conforming to the schema. How do I automate the creation of related SQL Server tables to store the XML data? I've considered creating C# classes from the XSD schema using the xsd.exe tool and letting something like Subsonic figure out how to make a shiny database out of it, but not ...

validating an XML schema with empty attributes

I am having trouble validating my xml schema. I get these errors on the schema 113: 18 s4s-elt-invalid-content.1: The content of '#AnonType_user' is invalid. 164: 17 s4s-elt-invalid-content.1: The content of '#AnonType_festival' is invalid. Element 'sequence' is invalid, misplaced, or occurs too often. and becuase...

Validate filled elements but ignore empty elements

Yaneeve was kind enough to fix my schema for me which was causing lots of problems This isn't so much of a problem but i would be nice to have this work Some of my elements are empty such as a mobile number or fax number. I need to validate the length of the element to make sure they have the correct number of digits but i don't want ...

LINQ to XML Cloning

Can anyone explain why the original address XElement street node changes? It looks like customer1 holds a reference to the address XElement but customer2 and customer3 have taken copies. Why did the original address change? (LINQPad example) var address = new XElement ("address", new XElement ("street", "Lawley St"), ...

How do I parse this simple XML in C#?

I want parse a SOAP xml response in C# (but I can't use standard SOAP interface, because wsld is incorrect). When parsing I want to have all elements with name (list element with name) and access to all its children. The overall appearance of the XML: <return> <item> <attr1>1</attr1> <attr2>X</attr2> </item> <item> <att...

ASP.NET MVC using as a RESTFUL Service and Consuming it easier way

Hi, I wanted to know, if say I had a MVC Application with some functionality and I want to provide this as a service to some of my clients. Do they need to go through coding and querying the XHTML data?(as it is represented in XHTML). I mean how do they generate proxy classes and use my methods? One of the ways is creating URI object bu...

How to get a non-XML output using JDOM XSLTransformer?

Hello, I have an XML file which I'd like to parse into a non-XML (text) file based on a XLST file. The code in both seem correct, and it works when testing manually, but I'm having a problem doing this programatically. I'm using JDOM's XSLTransformer class to apply the XSLT to the XML and it returns it in the format of a JDOM Docume...

C# check an element exists while using LINQ to XML

OK, bit of a random question, but the best way to do this is to just add the code, you'll be able to see what I mean straight away: XML: <?xml version="1.0" encoding="utf-8" ?> <customers> <customer> <id>1</id> <name>Blah-face</name> <Type>1</Type> </customer> <customer> <id>2</id> <name>Blah-face-2</name> ...

xsd.exe C# file to XSD file

I have an XML file that I used to create an XSD File and from there generated the C# code. However, during development I had to make some changes to that C# file. Is there a way I can use the xsd.exe tool to convert that C# file back into an XSD file? I'm hoping to avoid having to go and manually edit the XSD File. ...