xml

Adding text to p tag in Beautiful Soup

I was wondering if anyone knew how to add text to a tag (p, b -- any tag where you might want to include character data). The documentation mentions no where how you might do this. ...

Retrieving attributes from XML

Why does running this code... XmlDocument doc = new XmlDocument(); string xml = @"<?xml version=""1.0"" encoding=""utf-8"" ?> <BaaBaa> <BlackSheep HaveYouAny=""Wool"" /> </BaaBaa>"; doc.LoadXml(xml); XmlNodeList nodes = doc.SelectNodes("//BaaBaa"); fo...

XSLT for displaying XML as HTML

I have an XML document (in a .net C# web app) that I want to display in its simplistic form (similar to IE). I need it to be browser independent (or as much as possible) and have a consistent display. I have tried pushing the xml document through as "text/xml" and this is inconsistent and doens't work in some browsers. http://sources....

How to make second test passing in these C# Xml unit tests? What do I miss in initialization of XmlReaderSettings?

Issue description: I need to fix an issue with resolving of standard HTML entitities. I've implemented HtmlEntityReader - implementation of XmlReader which has a code to resolve entities Public API of our system provides a methods with usage of XmlReader, so user can pass XmlReader created using one of the XmlReader.Create methods ...

How can I locally save an XML file on an iPhone for when the device is offline?

My app is accessing data from a remote XML file. I have no issues receiving and parsing the data. However, I'd like to take the most current XML data and store it locally so - in the event that the user's internet service isn't available - the local data from the previous load is used. Is there a simple way to do this? Or am I going to ...

Scala: Given a scala.xml.Node, what's the most efficient way of getting the second (or n-th) child element?

Given a scala.xml.Node object (with white space and elements as child nodes) what's the most efficient way of getting the second (or n-th) child element? Usually I would go for the built-in (node \ "foo"), but sometimes I have to rely on the position of the element. For example, I could have two Choice groups that could be either foo or...

Android - Should I use multiple activities or multiple content views

Hi, i'm new with android. I'm working on an application using xml layouts. I wish to know which is better: 1. Use few activities and change its contentview 2. Use an activity for each 'view' needed If both works, in which case which option would be better? thx a lot ...

Ignore case while doing xsl:sort

I am trying to sort a XML doc using xsl:sort My requirement is to ignore case while doing the sort. xsl:sort have a case-order attribute which helps specify upper-first or lower-first, which is of no help for me. I also tried using translate function, something like this : <xsl:sort select="translate('abcdefghijklmnopqrstuvwxyz','ABC...

how do I filter values from XML file in python

I have a basic grasp of XML and python and have been using minidom with some success. I have run into a situation where I am unable to get the values I want from an XML file. Here is the basic structure of the pre-existing file. <localization> <b n="Stats"> <l k="SomeStat1"> <v>10</v> </l> <l k="S...

Where can i find a free xform editor?

I am new to xform, and i have a project and i have no idea on where to write my code. So any help? (I am working on windows XP SP2). ...

XML inside XML attributes. C# app settings in console application

Hello guys, in a XML settings file I am using for console application You have such structure: ... < appSettings> < add key="Message" value="Hello, World!" /> < /appSettings> ... You access them with ConfigurationSettings.AppSettings["Message"] I have also large strigs with line breaks etc. (e.g. SQL scripts templates) insid...

Count specific XML Nodes within XML

See this XML: <CMP> <OMP3> <personmenu> <submenuid>502</submenuid> <submenuid>503</submenuid> </personmenu> <accountsmenu> <submenuid>517</submenuid> <submenuid>518</submenuid> <submenuid>519</submenuid> </accountsmenu> <reportsmenu> <submenuid>522</submenuid> <submenuid>528</submenuid> <submenuid>536</submenuid> </repo...

(XSLT, Code optimization) How to output the nodes refering to the value of sibling-nodes .. ??

I am transforming XML to XML using XSLT, The objective is to read the value of tag <node1>, if it is null then it must be assigned with the value of <node2>, if incase <node2>, is also null, then default text "Default" has to be assigned .. to both tags .. EDIT: If <node2>is null and <node1> isn't .. then the code shouldn't update <node2...

HTML disappear after been created with javascript

Hi, I'm having another problem after solving this Trying to read XML file but he is always the same I'm creating HTML elements dynamically, and giving the values that i read from the XML file, the elements are always disappearing but after them been created. Any reason why that is happening? My Code is this in cs file script = "funct...

How should I create & map an XML file describing some import data to a DTO?

I have to write a import utility which will import some data held in an xml file. I imagine that I will create a simple DTO object which is the representation of the import data and then write all my code so that it does the import based on this object. The XML file will be the definition of the transfer format, so I expect that 3rd pa...

Getting the child node's name of XML using XSL

Hi, I have an XML program in the following structure <Part> <ID>1</ID> <Density>3</Density> <Parameter> <Element>Alloy</Element> </Parameter> </Part> I want to create an XSL which tranforms this XML in such a way that ID 1 Density 3 Element Alloy How I can do that?? Somebody can help me with this... ...

Rails: request.xml?

Hey, I would like to check whether the request is XML od HTML. When HTML the page is redirected to login form (if a user is not logged in) and when XML the user get not authorized status code. Example: class ApplicationController < ActionController::Base def require_user unless current_user IF XML RESPOND WITH CODE...

removing xml tag with regex

Hi, I need to remove the tag "image" with regex. I'm working with C# .Net example <rrr><image from="91524" to="92505" /></rrr> should become: <rrr></rrr> Anyone??? ...

XSD - how to allow elements in any order any number of times?

I am trying to create an XSD, and trying to write the definition with the following requirement: Allow child element specified to appear any number of times (0 to unbounded) Allow child elements to be in any order I looked around and found various solutions like this: <xs:element name="foo"> <xsl:complexType> <xs:choice minO...

Writing XML on Android

Given an instance of org.w3c.dom.Document, how do I save its contents to a file/stream? EDIT: As CommonsWare pointed out, there's no such possibility using classes from Android SDK. Can you recommend then a third-party library for saving Document contents to a file/stream? ...