Given an XML fragment that I want to parse with XPath I first need to extract the namespaces to add to the namespace manager. I've been trying to figure out the Regex pattern needed to extract xml attributes that define a namepspace. For example I want to get all the namespaces which I can do some more basic string manipulation on to sep...
$contents = "<?xml version='1.0' ?>
<authed>1</authed>
<book>read</book>";
im having a xml string like this
i want to add all the elements inside root tag
like this
$contents = "<?xml version='1.0' ?>
<root>
<authed>1</authed>
<book>read</book>
</root>";
...
Hello there!
I'm currently working on a C++ MFC project on visual studio 2003. The aim of this project is to be able to take an XML file containing language data, convert it to a simple CSV file and back to XML. To do this, I'm using the TinyXML library, which is simple and good enough for my needs.
The problem is that, once I try to c...
With XSLT, how can I change the following:
<root>
<element id="1" State="Texas" County="Dallas" Population="2412827" />
<element id="2" State="Texas" County="Harris" Population="3984349" />
<element id="3" state="Georgia" County="Fulton" Population="1014932" />
<element id="4" state="Georgia" County="Richmond" Population="212775...
What is the fastest way to add/replace a single attribute in an XML document. Regexps aren't stable for use in XML documents and XSLT isn't fast enough.
...
<Unit Number="1">
<Identifier Type="ABC" Text="STO0001"/>
<Identifier Type="DEF" Text="Some Value"/>
<Identifier Type="GHI" Text="20070805"/>
<Disposition Unit="Accept"/>
</Unit>
I need to validate that Type="DEF" Text="Some Value" is not empty
Something Like:
<xs:complexType name="requiredValue" abstract="true"/>
<xs:complexTy...
I've seen a few questions on this topic already but I'm looking for some insight on the performance differences between these two techniques.
For example, lets say I am recording a log of events which will come into the system with a dictionary set of key/value pairs for the specific event. I will record an entry in an Events table with...
I want to control the time of a counter. I need to receive XML data from a TCP/IP socket controlling the values of my counter.
Flash client 'LOADER' receives XML messages and loads swf files. How do I rewrite LOADER and LOADEDSWF to pass this type of event data? Correct my question if I'm wrong.
HOW I SEE IT "I'll see "Event.data" in...
I have the following (as an example) XML file and XSD.
<?xml version="1.0" encoding="utf-8" ?>
<foo>
<DateVal>2010-02-18T01:02:03</DateVal>
<TimeVal>PT10H5M3S</TimeVal>
</foo>
and
version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSc...
How to validate a XML in Java, given a XSD Schema?
...
Hello to all. About week age I asked the question here and got a great help. Now my question has continuation. Originally I had to convert XML into text file. Here's a sample XML file:
<DOC xsi:noNamespaceSchemaLocation="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DOC_REQUISITES DOC_DATE="2009-04-23" DOC_NO="99999999...
How do I retrieve the contents of a simpleXMLElement variable from a php file with jquery?
...
I'm seeing strange behavior when I try to parse XML using the LINQ XmlReader class. Test case below: it looks like whether I use (XElement)XNode.ReadFrom(xmlReader) or one of the Read() methods on XmlReader, it misses the second bar elements in the input XML. If any whitespace is added between the </bar> and <bar> then it will parse th...
Hey guys,
I'm trying to modify some XML values in a database. I can get it to work on columns that contain XML that are using the XML data type. However, I can't get it to work on TEXT columns.
Also, I can SELECT XML data on TEXT columns (by using CAST() to convert it to XML), but still can't UPDATE.
Example:
UPDATE [xmltest]
SET [...
Hello All,
I am hoping someone out there can possibly shed some light on a couple issues I am having with an image slideshow
I have been working on a simple slideshow for a project and everything was going great/as expected up until I created a function to hide the previous images before displaying the next. On the first pass through e...
Hi,
I am trying to create an option in my code to change layouts using preferences. I already have the two layouts created in XML, but I can't figure out how to swap between the two during runtime. I would like to cause it to check during onResume() since it is called directly after returning from the Preferences screen and when startin...
Sometimes you want to start an Activity by pressing a Button.
Is there a way to express that in XML? I.e. to tag the Button xml with the Activity to render when it is clicked? That would certainly be a lot quicker and slicker and shorter than writing the equivalent Java code to handle the event.
Peter
...
I'm looking to limit to the first 5 results returned here.
This works, but it does not limit the data set:
<?php
foreach($sxml->status as $status){
$name = $status->user->name;
$image =$status->user->profile_image_url;
$update =$status->text;
$url = "http://twitter.com/" .$status->user->screen_name;
echo "<li><a href=\"" . $url . "\"...
I'm looking for the Schema document on basis of which an XSD is created.
I need this because I want to transform an XML to XSD using XSL.
...
Hello
What XML-parser do you recommend for the following purpose:
The XML-file (formatted, containing whitespaces) is around 800 MB. It mostly contains three types of tag (let's call them n, w and r).
They have an attribute called id which i'd have to search for, as fast as possible.
Removing attributes I don't need could save around ...