xml

Why am I getting an extra character (a dot or bullet point) at the beginning of my byte array?

I have the following code used to get xml from a DataSet into a byte array using UTF-8 encoding: private static byte[] fGetXmlBytes(DataTable lvDataTable) { XmlWriterSettings lvSettings = new XmlWriterSettings(); lvSettings.Encoding = Encoding.UTF8; lvSettings.NewLineHandling = NewLineHandling.Replace; lvSettings.NewLineChars = ...

magento - error after changing catalogsearch.xml

Hi Everyone.. Was attempting to remove the Search Terms and Advanced Search from the footer links. I am now getting the following message: Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 103: parser error : XML declaration allowed only at the start of the document in /home/viviscal/domains/viviscal.ca/p...

Difference between Dynamically changing pages vs 2 static pages

I want to build a site that will ask if the user is male of female and then use that information to change all the pronouns on the page(s) to match the user selection. So if you enter male, then the page(s) will change all personal references to (him, his, he, etc). My choices are: 1) build 2 sites and have the user input direct the user...

iterate Write XML problem

Hello everybody, I am new here and to PHP, i am trying to write a xml file whitch had as source a XML file. When i read the XML and use the echo command I can see al the record of the source XML. but when i want to write it to a XML file i can only see one record. I have read al lot of things already: some thing i found was the use a...

Outputting XHMTL with xsltproc

Background: We've created a client portal that selects desired data points from our database and outputs them as XML. The client has provided us with their desired format in the form of an XSLT stylesheet. So our deliverable to them is preferably the most user-friendly format possible, preferably a PDF. Our service is in Perl, so we've ...

"Fatal error: Cannot redeclare" when reusing xml parsing code

I have a single xml parsing function that I'm trying to call multiple times as I only need to strip a little data out and continue on. Here is the function: //Parse Product ID from Product Sides function getProductSpecs($xml,$type) { // Setup arrary global $productspecs; global $count; $count = 0; global $type_chec...

Move multiple rows from a tree component to a dataGrid.

I'm working on drag-and-drop capabilities between a tree and a datagrid. The dataProvider of the tree is XML and the dataProvider of the dataGrid is an arrayCollection. I have it fully working when moving a single item from one to the other, but allowing multiple selections is failing. When the elements moved are leaf nodes, the follo...

How to do a wiredump of XMLRPC::Client in ruby?

I'm working on some code using XML RPC in ruby and need to see some debug info, how do you do that? ...

How to parse an xml ajax reply with jQuery?

Using an ajax POST request in jQuery, I get the following xml back from the server: <?xml version="1.0"?> <data> <subject> <val1>...</val1> <val2>...</val2> <val3>...</val3> </subject> <subject> <val1>...</val1> <val2>...</val2> <val3>...</val3> </subject> ... </data> The xml will have an arbitra...

Safely generating XML in Lua

I'm writing a Lua application that generates an Atom feed. Right now, I'm generating XML "by hand" -- writing strings to files. This doesn't seem like the best way, although it may be. I am getting nervous about having the escaping exactly right. Has anyone done anything like this in Lua before? Should I stick with generating "by hand...

How can I add an attribute to a child element using Perl's XML::Twig?

I have an XML string like this: <DATA> <CHILD_DATA ATVAL="value1"/> <CHILD_DATA /> </DATA> The final output I want is: <DATA> <CHILD_DATA ATVAL="value1"/> <CHILD_DATA ATVAL="value2"/> </DATA> My twig $t is at <DATA>. Now I want to add an attribute to the second <CHILD_DATA />. The attribute is ATVAL="value2". I tried th...

WPF DataTemplate to flatten out XML tree to a list?

Given xml that looks like this: <Root> <Fruittree name="Apple" ID="2"> <Branch name="West" ID="1"> <Fruit name="Foo"> <Fruit name="Bar"> </Branch> </Fruittree> <!-- more fruitrees etc... --> </Root> Using xaml with a XmlDataProvider and a DataTemplate, I want to display a list, perhaps in a listbox: ...

parsing xml and insert data in mysql table

I am parsing an xml file using php simplexml_load_file() and then inserting the desired data in a mysql ISAM table. The problem is that the code works "most" of the times, with 500 internal server errors here and there. The XML file that I am trying to process is big (around 50 MB), and it yields around 25000 rows in the mysql table when...

Pretty-printing output from javax.xml.transform.Transformer with only standard java api (Indentation and Doctype positioning)

Using the following simple code: package test; import java.io.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; public class TestOutputKeys { public static void main(String[] args) throws TransformerException { // Instantiate transformer input Source xmlInput = new StreamSource(new StringReader( "<!-- Doc...

Putting each attribute on a new line during xml serialization

Lets say I have a DOM object (or a string containing xml). Is it in any way possible to serialize the xml in such a way that each attribute appears on a new line? This is the output I want: <parent> <anElement attrOne="1" attrTwo="2" attrThree="3" /> </parent> Preferred if the solution a part of the ...

AS3 Assign Class to XML Loaded element

I need to load a set of images with from XML and assign Interactivity to them first I load the XML import flash.display.Loader; import flash.net.URLRequest; var loader:Loader = new URLLoader(); var request:URLRequest = new URLRequest("myXML.xml"); loader.load(request); loader.addEventListener(Event.Complete, proessFi...

How do I add multiple Namespace declarations to an XDocument?

I'm using an XDocument to build an Xml document in a known structure. The structure I am trying to build is as follows: <request xmlns:ns4="http://www.example.com/a" xmlns:ns3="http://www.example.com/b" xmlns:ns2="http://www.example.com/c" > <requestId>d78d4056-a831-4c7d-a357-d14402f623fc</requestId> .... </request> Notice th...

Does the XmlSerializer escape special chars like & ?

I'm trying to refactor a library that's transmits it's object as XML. Although I think the XmlSerialzer of the .NET Framework can handle the serialization, the class all have a ToXML function. In it all string values are being put through a function that escapes characters like & and alike. Does the XmlSerializer not escape those kind...

jQuery scope problem

I am trying to create a sort of generic xml parser, like this: Part 1: An object with filter is created: var product = { holder : { id: '', title: '', text : '', price: '' }, filter : { id: '', test: function( elementHolder ) { if( elementHolder.id == product.filter.id ) { return true; ...

How to extract relational data from XML in SQL Server

Hello, I'm new to XML world. I'm having a problem with XML data type in SQL Server 2005. I've a stored procedure that expects XML parameter. The value of the parameter as given below... DECLARE @productIds xml SET @productIds = '<ROOT> <AGENTLIST> <AGENT> <HOSTAPPLICATIONRECORDKEY>GRI</HOSTAPPLICATIONRECO...