xml

How can I allow (or replace) ampersands using .NET's XML library?

Let's say that I have the following XML: <someRootElement> <someTagWithUrl>http://www.google.com/s.php&amp;test=testing&lt;/someTagWithUrl&gt; </someRootElement> The ampersand inside the someTagWithUrl is invalid and needs to be escaped (by using &amp;), but suppose I have a single string with the entire above contents. How can I s...

Someting like Xml asserts for NUnit

Does NUnit support (perhaps by using a third party libraries) a smart comparison for xml data. Let's say we need to compare two xml files - the simplest way would be to compare xml content using the no-case sensitive string comparison, but that would only work in a trivial cases. Is there any library around which could simplify xml com...

Android: My Help Page comes up BLANK!

I am trying to create a very simple help page in my app. The layout xml for the page contains only a textview that displays the help info. In the Eclipse layout view, the layout looks perfect... however, when i try to load it in the emulator (via an OptionsMenu) it comes up as a blank black screen. What am I doing wrong?? Here is the Co...

How to save XML using PHP

Anyone know how I can create and save XML using PHP? I need something like this: <jukebox> <track source="" artist="" album="" title="" /> <track source="" artist="" album="" title="" /> <track source="" artist="" album="" title="" /> <track source="" artist="" album="" title="" /> </jukebox> ...

Need a Nested LINQ to XML query help

i have a XML file as follows: <?xml version="1.0" encoding="utf-8" ?> <publisher> <name>abc</name> <link>http://&lt;/link&gt; <description>xyz</description> <category title="Top"> <item> <title>abc</title> <link>http://&lt;/link&gt; <pubDate>1</pubDate> <description>abc</description> </item> <item> <title>abc</title> <link>http://&lt...

I use dom4j1.6 in java(xml), but I can't addattribute null value, What can I do?

In my source----- Element element1 = element.addElement("List"); element1.addAttribute("Number", (String)Map.get("NUMBER")); element1.addAttribute("Indicator", null); I want a result like that=> element1 Indicator=""/ I use use dom4j1.6 in java, I search the method, addattribute method => Attributes with null values are silentl...

XML type decomposition to rowset in stored proc using nodes()

I have the SP I call the following example ways (the call is not from SQL rather it is from a .net program) or -- run with a few grantees exec someproc 99999, '<grantees><grantee id="99"/><grantee id="100"/><grantee id="101"/></grantees>' -- takes about 1 sec with > 59s on xml decomp or perhaps -- run with lots of gra...

how to convert linq to xml query to string[]

here is my xml: <record> <id>12342</id> <name>xx</name> <blah1>asdfas</blah1> <blah2>asdfas</blah2> ..... </record> I would like to get all of the values and put it into a array. i tried the following, it returns "12342xxasdfasasdfas" instead of "12342","xx","asdfas","asdfas" var q = record.Elements("record").Select(r=>r.Value); s...

Create dynamic object with hierarchy from xml and c#

I want to create a dynamic object from a string of XML. Is there an easy way of doing this? Example String. <test><someElement><rep1>a</rep1><rep1>b</rep1></someElement></test> I'm trying to create an mvc editor for passing data through nvelocity and would like people on the front end to input xml as there data for parsing. Thanks i...

Is there a way to remove magic numbers from a XML Schema?

I have a WSDL with some types defined. Some elements accept lists of elements and on the service return I also have elements with list of values (or other elements). As a result I have some magic numbers in the XSD (e.g. minOccurs="10", maxOccurs="250" etc). These values 10, 250 etc are repeated throughout the XSD types. Is there a wa...

XML schema specifying transformation

Hi, I have generated an XSD file for an XML file and it's working when I am exporting data from Excel. I would like to know if it's possible to specify the XSL file in the Schema itself, so that when the XML file is created, the XSL is already assigned to it. Is that even possible? Or do I have to do it through Excel VBA code (which I...

How to avoid CopyTask and MoveTask phing build exception on not existing file

I'm creating build file for phing. The problem is that it must move a file which may not exist. If it doesn't I get BuildException "Could not find file ... to copy". In the Ant there was a property failonerror which ignored the errors of move and copy tasks, but there is no similar property for phing move and copy tasks. Move phing cod...

How to read an XML file with an undefined namespace with XMLReader?

I'm relatively new to parsing XML files and am attempting to read a large XML file with XMLReader. <?xml version="1.0" encoding="UTF-8"?> <ShowVehicleRemarketing environment="Production" lang="en-CA" release="8.1-Lite" xsi:schemaLocation="http://www.starstandards.org/STAR /STAR/Rev4.2.4/BODs/Standalone/ShowVehicleRemarketing.xsd"> <...

Omitting all namespaces from XslCompiledTransform.Transform output

How can I omit all XML-Namespaces from the xslt in the html-output? My XSL starts with: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions"&gt; and my code to transform the X...

Generate xml from form inputs

i have a form in Asp.net MVC. On submitting i want to generate the xml of the input. Whats the best way of doing it? I can do it by capturing the names/id of form in Post event and can generate xml. Is there any better automated way? ...

XMLReader - How to handle undeclared namespace

I'm reading a large ~300Mb gzipped XML file with XMLReader that get's automatically dumped to my server nightly (archaic, I know..) It is malformed ie, it has an undefined namespace and it's throwing an error ErrorException [ Warning ]: XMLReader::read() namespace error : Namespace prefix xsi for AttrName on NodeName is not defined ...

RDLC CustomPropertiesType add attribute

Hi, here is my problem.Reading the definition of RDLC files (http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition/ReportDefinition.xsd) i saw TextboxType has a XMLNode of type CustomPropertiesType which contains sequence of CustomPropertyType. The definition of CustomPropertyType is <xsd:complexType name="CustomProp...

perl xml parsing help

Hi All, I have a xml file like this <testcase> <sf_params> <dir>1</dir> <sfid>2</sfid> </sf_params> </testcase> I used xml::simple (perl parsing) and got the o/p as $VAR1 = { 'sf_params' => [ { 'sfid' => [ '2' ...

Howto show with Dojo XML-Data with sub-atoms in DataGrid

I have the following XML-File: <filter> <rule> <name>User1</name> <mail> <address>[email protected]</address> <address>[email protected]</address> <address>[email protected]</address> </mail> </rule> <rule> ...

Extending a element in the XML Schema

Hello guys! I'm trying to extend a element in my XML Scheme, but its not working: <xs:complexType name="instituicaoComPais"> <xs:complexContent> <xs:extension base="instituicao"> <xs:sequence> <xs:element ref="pais"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name=...