xml

build XML out of user's input

Hi guys, I wanted to see some of your ideas/opinions/suggestions on the following problem. The idea is to have a simple webapp (java webapp) collecting user's input that essentially is turned into an XML file? The final XML file has to be valid and has to conform to a DTD. What would be a good way to dynamically collect an input prese...

Is Scala/Java not respecting w3 "excess dtd traffic" specs?

I'm new to Scala, so I may be off base on this, I want to know if the problem is my code. Given the Scala file httpparse, simplified to: object Http { import java.io.InputStream; import java.net.URL; def request(urlString:String): (Boolean, InputStream) = try { val url = new URL(urlString) val body = ur...

Validate an XML file against local DTD file with Java

How can I validate an XML file against a DTD that is stored locally as a file? The XML file does not have any DOCTYPE declaration (or may have one that should then be overridden). I had a look at this thread but besides the fact they are using .NET I doubt that this is a good solution. Any input appreciated! ...

Where does out-of-process MSXML IXMLDOMDocument::save save?

Where does MSXML IXMLDOMDocument::save save? I mean when it's called with a file name argument. CComPtr< IXMLDOMDocument > doc; p->get_doc( &doc ); doc->save( CComVariant( L"C:\\pathto\\mydoc.xml" ) ); Where will "C:\pathto\mydoc.xml" be? Consider that the XMLDOMDocument is out of process, in this case located on a different physica...

Should I use Elements or Attributes in XML?

Hello I am learning XML from W3schools. Here: hXXp://www.w3schools.com/xml/xml_attributes.asp The author mentions the following: XML Elements vs. Attributes <person sex="female"> <firstname>Anna</firstname> <lastname>Smith</lastname> </person> <person> <sex>female</sex> <firstname>Anna</firstname> <lastname>Smith<...

Print XML tag names and values in Java

I have an XML document, and I want to print the tag names and values (of leaf nodes) of all tags in the document. For example, for the XML: <library> <bookrack> <book> <name>Book1</name> <price>$10</price> </book> <book> <name>Book2</name> <price>$15</price> </book> </bookrack> </library> T...

linq to xml access data based on field attribute

I have some xml like this: <Data> <Rows> <Row> <Field Name="title">Mr</Field> <Field Name="surname">Doe</Field> <Row> <Rows> <Data> using linq how can I get the value contained in the field element where the attribute is surname thanks ...

XInclude Schema/Namespace Problem?

I'm trying to use XML Includes to help manage a large XML structure that needs to be usable by both humans and machines. But am experiencing a myriad of problems when trying to construct XML files that can be validated against an existing schema. Here's a simplified example of what I'm trying to do. My "main.xml" file does not validat...

Stripping spaces between XML nodes with Python

Is there a easy way to accomplish the same thing in Python as xsl accomplishes with: <xsl:strip-space elements="*"/> So for instance in the following for event, elem in ElementTree.iterparse("/tmp/example.xml"): if elem.tag == "example": print ElementTree.tostring(elem) when the example nodes are printed out all the sp...

How to improve on PHP's XML loading time?

Dropping my lurker status to finally ask a question... I need to know how I can improve on the performance of a PHP script that draws its data from XML files. Some background: I've already mapped the bottleneck to CPU - but want to optimize the script's performance before taking a hit on processor costs. Specifically, the most CPU-co...

Magento Custom Module, Fatal error: Call to a member function setFormAction()

When I hit my module on this url http://localhost/xxx/index.php/TradeEnquiry I get this error Fatal error: Call to a member function setFormAction() on a non-object in C:\wamp\www\stockdisplays\app\code\local\Stock\Tradeenquiry\controllers\IndexController.php on line 55 Line 55 is this: $this->getLayout()->getBlock('tradeen...

Anybody also epriences problems with JAXB validation, when XSD contains regular expression character class \w?

Hi, We are using JAXB 1.0.6 (the project has started with JDK1.4 and this is the last compatible version) to create XML-Files from a XSD specification. The XSD defines an attribute "email" with the following regexp pattern. <xs:simpleType name="EmailAddress"> <xs:restriction base="xs:string"> <xs:minLength value="0"/> <xs:maxLengt...

Should I Create an API or Webservice ?

Currently I am working on an app property website. Now currently if the user wants to upload a new establishment he has to enter the property details in their in house system and seperately on a different website linked to the website front end. So we would like to eliminate this duplicate data entry. We would like to provide a webservi...

How do I find out if my html document is well formed in ruby

Every html document is an xml document. In the current project there are a lot of html tags which are not properly closed. This is a ruby on rails application. I want to put an after filter which will parse the whole html output and will raise an error if the parsing detects that it is not a well-formed document. In this case well-forme...

Send XML via HTTP Post to IP:Port

Ok so to start off, I'm not using any sort of web service. Right now I don't know a whole lot about the application receiving the XML other than it receives it. Big help there I know. I didn't write the receiving application but my company doesn't have any useful ways of testing the XML transmission phase. I basically want to send an XM...

Crystal Reports -Invalid Argument provided. Failed to open a rowset. ADO.Net xml

Okay here is the scenario I have a VB6 application that is getting re-written for asp.net 3.5. I have a grundle of Crystal Reports that are getting updated to Crystal Reports 10.5 (which is included in Visual Studio 2008). All of the old reports used OLEDB. What I am doing is taking the sql statements used in the reports and putting t...

Why do I have to SET ARITHABORT ON when using xml in sql server 2005?

Why do I have to SET ARITHABORT ON when using xml in sql server 2005? I tried researching why I have to set this but couldn't find an answer that told me why. Only that it needs to be set. Here is the specific error message I get when I take out the SET ARITHABORT ON line: PARAMETER ERROR: INSERT LIST COULD NOT BE PARSED - INSERT fail...

ASP.NET: Trying to parse Google Base XML, can't access "g:" tags

My customer doesn't want a database but would prefer to update their data in an XML file. This is all well and good. However, they also want their items to be submitted to Google products. This complicates things a bit. I decided to attempt to just use the Google XML file for the database rather than create and maintain two separate file...

Why XPath expression doesn't return any results in C# but it does outside C#?

I'm working on Open XML document format for excel sheets. var nodeList = WorksheetXml.SelectNodes(@"//c[child::f]"); it should return all rows with formulas, but it doesn't return anything. The same xml on Oxygen Editor, when applied the same xpath expression, returns all of them. I am copying WorksheetXml inner xml to assure the con...

ASP.NET/XML/LINQ: Extract Attribute from Element

I have the following in an XML file: <entry> ... <link href="http://www.example.com/somelink" /> ... </entry> I want to extract the "href" attribute. I've been getting my list of elements like so: Dim productsDoc = XDocument.Parse(productXML.ToString()) Dim feed = From entry In productsDoc...<entry> Select entry For Each entry I...