xml

Parsing broken XML with lxml.etree.iterparse

Hi, I'm trying to parse a huge xml file with lxml in a memory efficient manner (ie streaming lazily from disk instead of loading the whole file in memory). Unfortunately, the file contains some bad ascii characters that break the default parser. The parser works if I set recover=True, but the iterparse method doesn't take the recover ...

Inject an empty string via Structuremap xml config

When I use the following in a structuremap xml config file, it is like I didn't specify the captureFileName parameter at all. How can I inject an empty string? ...

Insert XML into SQL Table XML column

Am trying to insert XML into XML Column.. getting following error: . Msg 6819, Level 16, State 1, Line 5 The FOR XML clause is not allowed in a INSERT statement. My SQL query declare @tempTable Table (xmlValue xml) insert into @tempTable select EmployeeName, EmployeeSalary from Employee2 for xml path('EmployeeDetails') what am i doi...

Format XML returned from SQL for XML

Here is my Query : select EmployeeName, EmployeeSalary from Employee2 for xml path('EmployeeDetails') returns <EmployeeDetails> <EmployeeName>xxxxx</EmployeeName> <EmployeeSalary>5000.00000</EmployeeSalary> </EmployeeDetails> how can i get output as <EmployeeDetails> <EmployeeName = xxxxx /> <EmployeeSalary = 500...

XML visualization by mxGraph (www.jgraph.com) from Java

I would like to visialize XML-tree by mxGraph from Java. Is it possible? How? Are there examples? ...

Parse XML string in VB.NET

I am trying to parse a particular attribute/value pair from XML in VB.NET. The XML is originally a string that looks like XML but it needs to be converted to an XML-like datatype or structure before I can parse it. How can I convert this string into XML, and then parse the info that I need? EDIT: Dim doc As XDocument = XDocument.Pa...

android communicate with webpage, get 502 error

I have a friend who's written a servlet which just serves XML (just XML, no SOAP or etc., Content-Type: text/xml). Now I'm trying to access it using android. I can access the page fine if I surf to the page with firefox, but if I access it using my android application I get an HTTP 502 error. The code I'm using is: AlertDialog alertDi...

Endless runtime for a script that sometimes works

After I execute this code asp scripts quite working. <!-- #include file="Connection.asp" --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <% function Page() { var db = new DBConnection; this.DAL = db.retriveDAL("Content"); var url = new String(Request.ServerV...

Read XHTML with XDocument?

How to read XHTML with XDocument, without downloading DTD. How to resolve the DTD references? No, you can't just say: settings.ProhibitDtd = false; settings.XmlResolver = null; as given in some previous answer, which is absolutely wrong. What about the entities then: &nbsp; Also I am not interested in HTMLAgility pack, again wrong an...

SQL join using CSV values ? Using Xml maybe ?

Hi, I'm trying to join two SQL tables, parent (which I have complete design control over) and child (which I cannot change). I have changed the parent table so that it has a varchar column, containing a CSV list of the ids of the child records. I would now like to do a select returning one row per parent, and some counters re. the child...

Mapping complex result set with Dom4j

I'm trying to create an XML document from a complex result set, i.e. a result set with multiple joins, so a competition has a bunch of questions, and a question has a bunch of answers. So the document would end up looking something like: <competitions> <competition id="12"> <question id="3"> <answer id="34"> The ans...

XSD force to use a particular order for the elemnt with attribute.

Hi, I've an XML file like the one below <transaction name="TEST_EX" type="singletonComplex"> <vo class="svc.vo.UserProfile"> <field deepMapping="true"> <vo class="svc.vo.UserVO"> <field name="UserName" column="User_Name" type="String"/> <field name="Age" column="User_Age" type="Integer"/> </vo> </field> <fi...

XSD, restrictions and code generation

Hello, I'm working on some code generation for an existing project and I want to start from a xsd. So I can use tools as Xsd2Code / xsd.exe to generate the code and also the use the xsd to validate the xml. That part works without any problems. I also want to translate some of the restrictions to DataAnnotations (enrich Xsd2Code). For ...

How to present a type of an element in xml-schema?

I'm making a xml schema and I have to present database columns which have name, type and table they belong to. Like this: <xs:complexType name="tMappingItem"> <xs:sequence> <xs:element name="name" type="xs:string" /> <xs:element name="type" type="xs:string" /> <xs:element name="table" type="xs:string" /> </xs...

Crossbrowser XmlDsig

I am building a web site where the user has to digitally sign a xml reciept to confirm that he recieved the package. I am currently doing this using a custom ActiveX control in IE. I was wondering if I could accomplish the same thing with/for other browsers. Is it even possible? ...

PHP - Duplicate XML node using Simple XML

I need to load an XML source using Simple XML, duplicate an existing node with all his children, then customize an attribute of this new node before rendering XML. Any suggestion? ...

How to provide relative schemalocation in xsd

Hi If i am defining to xsd main.xsd and sub.xsd Now if i want to import the sub.xsd into main.xsd how can i do it . <xsd:import namespace="http://localhost:8080/my-app"; schemaLocation="main.xsd"/> if both are in same folder ..but i want to give a relative url how do i do it . ...

Error callback every time when trying to POST XML using jQuery in non-IE browsers

I am trying to communicate with Google's spell check service using jQuery. Google's service requires that you post XML and it will in turn return an XML response. In IE, the success callback gets hit every time, but in non-IE browsers (tested in Firefox and Chrome) the error callback is getting hit every time. The biggest difference is ...

help with structuring xml document

i have a database that contains countries and cities. i want to export this information to a xml document, but wonder how to structure it. should i do it like this: <country> <name>Canada</name> <city> <name>Toronto</name> <population>1423200</population> </city> <city> <name>Ottawa</name> <population>1423200</population> ...

Add attribute to result of xsl:apply-imports

Hi, I have an XSL stylesheet (A) that imports another one (B). A overrides a template (t) in B, and invokes B's template with apply-imports: From A: <xsl:template match="t"> <xsl:apply-imports/> </xsl:template> From B: <xsl:template match="t"> <p><!-- Do something --></p> </xsl:template> I now want A to add an attribute t...