xml

Is there a way to map a tag in flex to components in multiple directories?

Given a flex application or module, you can specify a custom xml namespace as follows: <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:custom="custom.namespace.*"> We can then refer to mxml components in the directory custom/namespace/ using the custom tag. For example, if I have the components Custom1 and Custom2 in the c...

Geting xml data using xml parser expat

Hello, I have managed to parse ok. But now I am having trouble getting the values that I need. I can get the element and the attributes. But cannot get the values. I would like to get the value of frame in this xml it is 20. /* track the current level in the xml tree */ static int depth = 0; /* first when start element is encountered *...

What are some options for XML on the iPhone?

I have implemented NSXMLParser in my app and I am reviewing alternatives. My complaints about NSXMLParser are that it's convoluted to implement for simple files, and it's not the zippiest thing around either. So far I've identified: TouchXML Objective-XML Any others? And what's your experience with these? Thanks for your input! ...

XPath to find nested values

I have some XML I'm having trouble processing with XPath. I can't seem to get the values I'm looking for. The XML is structured like this: <Group> <Menu> <Name>Top Menu</Name> <Document> <DocName>Readme.txt</DocName> </Document> <Menu> <Name>Sub Menu</Name> <Document> <...

Any way to make XmlSerializer output xml in a defined order?

Currently I'm using XmlSerializer to serialize and deserialize an object. The xml is generated in an undefined order which is understandable but makes it annoying when comparing versions of the object, since the order of properties is different each time. So for instance I can't use a normal diff tool to see any differences. Is there an...

Parser using RegEx and XML, in C#

I am making an application where I need to verify the syntax of each line which contains a command involving a keyword as the first word. Also, if the syntax is correct I need to check the type of the variables used in the keywords. Like if there's a print command: print "string" < variable < "some another string" //some comments ...

newbie validate xml using xsd

Hi all, I need validate an xml using xsd in .net, my files see next post any help about it ? any sample code source ? Thanks in advance, king regards ...

How to resolve all entity references in XML and create a new XML in C#?

How can I resolve all entity references in the XHTML document and convert it to plain XHTML document that IE can understand? The example XHTML: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html [ <!ENTITY D "&#x2014;"> <!ENTITY o "&#x2018;"> <!ENTITY c "&#x2019;"> <!ENTITY O "&#x201C;"> <!ENTITY C "&#x201D;"> ]> ...

How to use a class for xml related logic taking xml file "uri" as initializer?

Hi , i have a project in which i created two classes TreeDisplay(Form.cs) and MytreeNode class in same namespace. TreeDisplay class contains all the GUI related stuff like Browse button textbox,label,progress bar and TReeView. I want the user to select a XML file through browse button which will be displayed in textbox.The Xml file sele...

Navigating to nodes using xpath in flat structure

I have an xml file in a flat structure. We do not control the format of this xml file, just have to deal with it. I've renamed the fields because they are highly domain specific and don't really make any difference to the problem. <attribute name="Title">Book A</attribute> <attribute name="Code">1</attribute> <attribute name="Author"> ...

Elegant way to read business rules stored in XML file

I have to read business rules stored in XML file (I am using VC++/MFC/MSXML). XML consists of rules. Each rule has a set of conditions and actions. What would be an elegant OOP design for such system? What design patterns would you use if you where a designer of such system? update: Rules are put in sequence and executed one buy one if ...

How do I add a namespace while doing XmlSerialization with an XmlWriter?

I am using the XmlWriter in conjunction with Xml Serialization. I am able to output the XML fine, but how to include the xmlns attribute with the XmlWriter seems to be escaping me. To write the start of the document I use the following: Writer.WriteStartDocument(); Writer.WriteStartElement("urlset","http://www.sitemaps.org/sch...

MS Enterprise Library Configuration Application Block removed from 4.1 stack ?

Not sure why the config app block is removed from the latest stack. Is there a preferred configuration framework out there? I am looking forward to a solution to read/write xml configuration information from C#. Edit#1 : Is it true that this functionality is now moved to System.Configuration ? Can we use this to read\write on a custom ...

xpath: find a node that has a given attribute whose value contains a string

Is there an xpath way to find a node that has a given attribute whose value contains a given string? For example I have an xml document and want to find a node where the address attribute contains the string Downing, so that I could find the following node: <person name="blair" address="10 Downing St. London"/> ...

XPath tools for Mac OS X

When I worked mostly in Windows, I used Stylus Studio to test out XPath on my XML files. Now that I primarily use OS X, I haven't found an equivalent tool. What tools for OS X do you recommend for XPath work? ...

XSLT - Matching nodes that have that a certain node inside them (like jQuery ":has")

Let's say I have the following XML file <a id="123"> <b type="foo" value="1" /> <b type="baz" value="1" /> </a> <a id="789"> <b type="bar" value="12" /> </a> <a id="999"> <b type="foo", value="2" /> </a> I want to get a list of all the 'a' nodes that have a 'b' subnode with a type="foo" and value="1". You can do something s...

How to replace xml special chars manually?

My application produces an xml file that is then xslt transformed into a nice html report. I have a problem with \n however. There are some xslt techniques to do it, but they are pretty awkward and time consuming. So my solution was to do a string.replace \n to < br /> and then to force the xmlWriter to write this with WriteRaw(text...

How to parse/ignored malformed XML parts?

I'm write a Air application that consumes a beta webservice API. Sometimes this APIreturns me a malformed XML node and actionscript will raise an error when I try creating the XML object out of it. What I've been doing is just try/catching the result and ignore the whole response if the XML is bad, but I could just ignore the malformed ...

Remove empty xmlns="" after Xml Serialization

So I am still asking questions about this topic :-( So I create an object, decorate it with the Xml Serialization Attributes, from what I have seen I add an empty namespace to the xml serialization namepsace collections so as not to get the superfluous attributes I did not intend to have. EDIT: The attribute I mean are these: <url...

XSLT: How to represent OR in a "match" attribute?

I want to perform a series of operations on elements that matched the name "A" or "B". I'm thinking of something like this below, but it doesn't work. <xsl:template match= " 'A' or 'B'" > <!-- whatever I want to do here --> </xsl:template> Couldn't find the appropriate XSLT language reference for it. Please help! Thanks!! ...