xml

What's the most efficient way to locate and set element values in an XDocument?

Given the following XML 'template': <Request module="CRM" call="list_service_features" id="{ID}"> <block name="auth"> <a name="username" format="text">{USERNAME}</a> <a name="password" format="password">{PASSWORD}</a> <a name="client-id" format="counting">{CLIENT-ID}</a> </block> <a name="service-id" format="countin...

How do I set a minimum length for an integer in an XML Schema?

I am in the process of creating an XML Schema and one of my values is a year. As such, I'd like to ensure that all values have exactly 4 characters. To do so, I am using the following syntax: <xs:element name="publish_year" maxOccurs="1"> <xs:simpleType> <xs:restriction base="xs:positiveInteger"> <xs:totalDigits value="4"/...

W3C XML Schema and the maximum integer for maxOccurs

I work on a W3C XML Schema (not written by me). One tool, xmllint, refuses to use the schema: traceroute.xsd:658: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'maxOccurs': The value '4294967295' is not valid. Expected is '(xs:nonNegativeInteger | unbounded)'. 4294967295 is 2^...

HTML - xml data islands

I am designing a web app and I intent to embed data on an xml island so that I can dynamically render it on an HTML table on the client-side based on options the users will select. I have the broad concepts, but I need pointers on how to use DOM in navigating my xml. And how to update my xml island possibly for posting back to the serve...

C# - Best Approach to Parsing Webpage?

I've saved an entire webpage's html to a string, and now I want to grab the "href" values from the links, preferably with the ability to save them to different strings later. What's the best way to do this? I've tried saving the string as an .xml doc and parsing it using an XPathDocument navigator, but (surprise surprise) it doesn't nav...

Problem Implementing XmlTextWriter in new XmlRecordsetWriter for Streams

For background see my question here. So the problem now isn't that I can't send a DataSet to classic ASP but that it can't do anything with it. So I found some code to create a recordset xml structure from a DataSet. I have tweaked it a little from it's original source. The problem is that I can't seem to extract the base stream and ...

Which language is easiest and fastest to work with XML content?

We have developers with knowledge of these languages - Ruby , Python, .Net or Java. We are developing an application which will mainly handle XML documents. Most of the work is to convert predefined XML files into database tables, providing mapping between XML documents through database, creating reports from database etc. Which language...

SAML Assertion WriteXML issue in C#

I've created an instance of a SamlAssertion, and added the the authorization statement and attribute statments to it, and now I want to print out the XML so I can do an HTTP post, but not all of the assertion is being outputed. What am I missing (I'm sure it's something bone-headed)? Here is the code I'm using: // Add the Statements t...

what's the easiest way to generate xml in c++?

I've used boost serialization but this doesn't appear to allow me to generate xml that conforms to a particular schema -- it seems it's purpose was to just to persist a class's state. Platform: linux What do you guys use to generate NOT parse xml? So far I'm going down Foredecker's route of just generating it myself -- it's not a larg...

How can I prevent XML::XPath from fetching a DTD while processing an XML file?

My XML starts like this $ cat a.xhtml <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; ... My code starts like this use XML::XPath; use XML::XPath::XMLParser; my $xp = XML::XPath->new(filename => "a.xhtml"); my $nodeset = $xp->find('/html/body//table');...

Logging component that produces xml logs.

A lot of programs log things into a text file in a format something like this: 11/19/2008 13:29:01 DEBUG Opening connection to localhost. 11/19/2008 13:29:01 DEBUG Sending login message for user 'ADMIN'. 11/19/2008 13:29:03 DEBUG Received login response 'OK' for user 'ADMIN'. ... However, I prefer something more structured like XML ...

how to use libxml2 to modify an existing xml file?

I need to take an existing xml file, and modify just a few attributes and write the file back out. I was thinking of using libxml2 to get this done. Application is C/C++ running on Linux. Thing is, libxml2 seems to include several variations of the kitchen sink, along with portable washrooms, showers, and various other things connecte...

How dow I select multiple sets of attributes within an XML document using XPath?

Hi there, I am having trouble constructing a single XPath statement to return a set of attributes comprising of attributes of two or more different names. For example take the following XML document: <root> <line name="one" alpha="a1" beta="b1"/> <line name="two" alpha="a2" beta="b2"/> <line name="three" alpha="a3" beta="b3"/> </r...

Find all nodes from an XML using cElementTree

Is there a way to find all nodes in a xml tree using cElementTree? The findall method works only for specified tags. ...

How to choose returned column name in a SELECT FOR XML query?

MS SQL has a convenient workaround for concatenating a column value from multiple rows into one value: SELECT col1 FROM table1 WHERE col2 = 'x' ORDER by col3 FOR XML path('') and that returns a nice recordset: XML_F52E2B61-18A1-11d1-B105-00805F49916B ---------------------------------------- <...

How to validate compliant XML sitemap?

For the following header I get the same two errors on all my sitemaps. It's confusing because, if Google can't read my sitemap, then how can they say that each URL has the same priority? The header counts as line 2, after the XML declaration. Google claims only to have indexed about 2% of the URLs from the maps. Please help. UPDA...

Getting sqlcmd output into a GridView

I am designing an ASP.NET website that will run sqlcmd, get some output and put this into a grid on screen. I was wondering if there is a method for reading the results of a query from sqlcmd into some kind of format that I can work with, XML, DataSet etc. Is there a friendly switch in sqlcmd that will output it in a nice format or wil...

Locating the getter and setter access modifiers in the EdmItemCollection of Entity Framework

I've been creating a nice T4 template for a repository pattern for my entities. Instead of manually parsing the xml in the edmx file I use the EdmItemCollection to create a object graph presentation for the conceptual model. I've been able to get a lot of information out of this model. But I cant find where to locate the Getter and Sett...

Generate class for schema with abstract complex type

I'm working with some schema which defines an abstract complex type, eg. <xs:complexType name="MyComplexType" abstract="true"> This type is then referenced by another complex type in the schema: <xs:complexType name="AnotherType"> <xs:sequence> <xs:element name="Data" type="MyComplexType" maxOccurs="unbounded"/> </xs:sequence...

c# XML manipulation VB code conversion query... and more!

I am following a VB tutorial to do some HTML manipulation using LINQ It has the following construct Imports <xmlns="http://www.w3.org/1999/xhtml"&gt; How do I do the same in C#? There appears to be something called an XMLNamespaceManager that may hold the solution, but I am too foolish to understand how to work it, and I am not sur...