xml

Include language files (as XML) on a XSLT

I doing the right transformations to develop a multilingual website. All the text of this website needs to be taken from an XML file because the output of the site will be the processed file. This are the basic files, index.xml: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="xsl/index.xsl"?> <page> <...

ASP.NET/XML: Convert XmlDataSource to HTML?

How can I parse an remote xml file with XMLDataSource to HTML? Xpath? Can someone show me a quick demo please? Thanks! ...

Recursively Parse XMl in Flex / As3

Ho, how can I recursively analyze/modify XML in Flex / As3? Let's say I have this XML: <div> <P ALIGN="center"> <FONT FACE="ArialV" SIZE="15" COLOR="#000000" LETTERSPACING="0" KERNING="1"> </FONT> </P> <P ALIGN="center"> <FONT FACE="ArialV" SIZE="12" COLOR="#000000" LETTERS...

XML vs MySQL for Large Sites

For a very large site such as a Social Network (say Facebook), which method would you recommend for user accounts storage? 1) Single XML files for each type of features, on the user's directory: basicinfo.xml, comments.xml, photos.xml, ... 2) MySQL, although not sure how to organize on this. Maybe separated databases for each feature? ...

XML/XSL: Sum in foreach loop with conditional (special case)

I have the following XML: <root> <groups> <group id="101"> <number>10</number> <children> <leader id = "A" /> <members> <member id="1"> <member id="2"> <member id="3"> </members> </children> </group> <group id="102"> <number>20</number> <children> <leader id = "A" /> <members>...

How to deny direct access to an xml file in the server

I have an html file index.html (in my server say abc.com) which accesses xyz.js like <script type="text/javascript" src="xyz.js"></script> The javascript file in turn accesses data.xml file. The files index.html,xyz.js and data.xml are in the same folder. How can I deny direct access to xyz.js and data.xml if a user types abc.com/x...

Reading Xml file using LINQ in C#

I have a list of String List<String> lst=new List<String>{"A","B","C"} And an xml file like <Root> <ChildList> <Childs> <Child Name="a1" Val="A"/> <Child Name="a2" val="A"/> <Child Name="b1" val="B"/> </Childs> </ChildList> </Root> i need to read contets of the xml file and add to a dictionary ...

Change Value of the last Attribute in an XML c#

I was working on a bunch of XMLs that all share an attribute that contains the string "name" in them. The following code selects the attribute with string "name" in it and assign a new value to it. public void updateXmlFile(string strFileName) { try { //Load the Document XmlDocument do...

Merge 2 XML files, merge keys and apply it as a template

I have to files XML files: language.xml and menu.xml. The first one is loaded by default, the second is loaded with <xsl:param />. language.xml: <?xml version="1.0" encoding="utf-8"?> <language> <header> <menu> <title>Title of example</title> </menu> <menu> <title>Title of example 2</...

How do I change this function to add the child nodes into the //root/Product/Genres node instead of adding to the end of the file (i.e. after </root>

It works properly in the way that it breaks up the comma-separated values into an array (with explode), but when it adds the child nodes, they show up after the closing root tag. What I'm trying to do here is replace the <Genres>Adventure,Crime,Action</Genres> with <Genre>Adventure</Genre> <Genre>Crime</Genre> <Genre>Action</Genre> A ...

Reading Xml file contents to a class instance in C#

i have a class like class CXmlData { String Data1=""; String Data2=""; List<String> lst=new List<String>() } and a Dictionary Dictionary<String,CXmlData> dict=new Dictionary<String,CXmlData>(); The xml file is having the following structure <Root> <ChildList> <Children> <Chil...

JAXB: How to unmarshall objects in lists?

Perhaps a stupid question: i have a List of type <Data> which i want to unmarshall into a XML file. This is my class Database containing an ArrayList... @XmlRootElement public class Database { List<Data> records = new ArrayList<Data>(); public List<Data> getRecords() { return records; } public void s...

Getting XML Error when saving blogger template.

I am getting the below mentioned error, when i try to use the xml code from here. The template is not mine, but a friend's. I am trying to use the same for my blog. Please let me know what is the error. Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message:...

How can I remove an XML modification in Change-mode (WiX 3.5)

I have created an WiX 3.5 installer with multiple features. One feature performs some XML changes which works fine. I have read that these changes can be undone while uninstalling the application by using the permanent attribute. Now imagine the following case: The user installs the whole application. Feature 1 does some XML changes. N...

Pass through XML from another website

I am trying to pass through some XML from an external website. What is the best way of doing this, through c# webpage or asp.MVC? ...

LINQ to XML generates \r\n between tags?

Hello, I am generating a XElement having this structure: <TestNames>\r\n <Test>YA</Test>\r\n <Test>YO</Test>\r\n </TestNames> How do I get rid of the whitespaces and \r\n in a non-hack way :) Update: XElement testsXmlDocument= new XElement("TestNames"); foreach (string test in selectedTests) testsXmlDocumen...

command line menu (CLI) from XML

Hi, assuming the following xml as input <root><element1>value1</element1><element2>value2</element2></root> I would like to create a CLI with it's options created automatically from the XML elements For example: Enter value for element1: Enter value for element2: element1 and element2 are extracted from the XML input. Is there an...

XSL removing empty nodes within the same code

Hi there, I've created the following XSL stylesheet which takes an XML packet ( given to me from SVN ) and converts all the "entry" nodes, which don't include the text "archive", into a comma-separated list for my ANT script. An example XML file looks like this.... <?xml version="1.0"?> <lists> <list path="https://mydomain.com/branches...

Removing set of tags from within another set, using regular expressions

Hello, I've got a big XML file I'm editing with BBEdit. Within the XML file, which is a digital recreation of an old diary, is text that is enclosed in note tags. <note>Example of a note.</note> Some note tags, however, have quotations enclosed in quote tags nested in them. <note>Example of a note, but <quote>"here is a quotation w...

Help with Android XML layout

I am trying to get my xml to lay this out properly. How it is now, the video is mooshed. If I take away the android:layout_below="@id/day_scroller" in the VideoView tag and add android:layout_centerHorizontal="true" the video size is now proportioned, but I lose my content that is display in my android:id="@+id/day_container" ...