xml-parsing

Parsing XML with no closing tags in Java

故事扮演 提交于 2019-12-13 08:27:49
问题 I am having trouble parsing an XML with no closing tag. Please see snippet of the xml below. I have tried SAX and also StAX Parser they both need a properly formatted XML with closing tag XXYY....as you can see below the XML format is a little bit different... Please help me if there is any API out there that can help me parse this or if SAX/StAX can help me achieve what I want.... :( <Employees> <Employee> <Detail> <Date>2018014 <Name>XXYY <Age>0 <LANGUAGE>ENG <Manager> <MName>YYXX <MID>5959

reading xml file with XmlReader reads only the first element

ⅰ亾dé卋堺 提交于 2019-12-13 08:27:34
问题 I'm having problems reading child elements with XmlReader. My xml file <?xml version="1.0" encoding="UTF-8"?> <WateringZones> <WateringZone> <Enabled>True</Enabled> <Name>Calle 1</Name> <Relay>1</Relay> <Monday>True</Monday> <Tuesday>True</Tuesday> <Wednesday>True</Wednesday> <Thursday>True</Thursday> <Friday>True</Friday> <Saturday>True</Saturday> <Sunday>False</Sunday> <WateringTurns> <WateringTurn> <Enabled>True</Enabled> <Name>Turno 1</Name> <Minutes>5</Minutes> </WateringTurn>

Read XML file with jQuery

做~自己de王妃 提交于 2019-12-13 08:26:27
问题 I have an xml file in the form: <cart> <itemCount>1</itemCount> <cartTotal>33.94</cartTotal> </cart> This is to track what is in the contents of an ecommerce shopping cart. So it will always only have one "cart" node. I want to read the "cartTotal" field. If it is greater than 0, then I want to display my "View cart" button on the website. I've tried the following and it isn't working: $(document).ready(function(){ $.ajax({ type: "GET", url: "https://www.example.com/file.xml", dataType: "xml"

Parse xml with varying Key

微笑、不失礼 提交于 2019-12-13 08:22:44
问题 I'm trying to parse the XML below: <plist version="1.0"> <array> <dict> <key>SubTitle</key> <array> <dict> <key>Values</key> <array> <string>D1</string> <string>D2</string> </array> <key>Title</key> <string>Chapter One</string> <key>supportsEdit</key> <true/> </dict> <dict> <key>Values</key> <array> <string>DC1</string> <string>DC2</string> </array> <key>Title</key> <string>Chapter Two</string> <key>supportsEdit</key> <true/> </dict> </array> <key>MainTitle</key> <string>Science</string> <

Parsing the CDATA section in XML using XML Pull Parser

本小妞迷上赌 提交于 2019-12-13 08:03:06
问题 Sample XML <feed xmlns="http://www.w3.org/2005/Atom"> <title>NDTV News - Top Stories</title> <link>http://www.ndtv.com/</link> <description>Latest entries</description> <language>en</language> <pubDate>Wed, 31 Jul 2013 22:33:00 GMT</pubDate> <lastBuildDate>Wed, 31 Jul 2013 22:33:00 GMT</lastBuildDate> <entry> <title>Narendra Modi to be BJP's PM candidate, announcement before crucial assembly polls: sources</title> <link>http://feedproxy.google.com/~r/NdtvNews-TopStories/~3/XN7dMIDe5YI/story01

XML parserror: junk after document element

笑着哭i 提交于 2019-12-13 07:54:08
问题 i keep getting a xml parse error, and i think its gotta do with spaces and comments, but since i'm kinda new to php, mysql and xml i'm not 100% sure if the following code is correct. I am getting the error: XML-parsefout: troep na documentelement Locatie: xml.php Regelnummer 10, kolom 1:<project id="90"> ^ Translated: XML-parseerror: junk after document element Location: xml.php Regelnummer 10, kolom 1:<project id="90"> ^ Code: <?php $sql = "SELECT * FROM projecten ORDER BY id"; $res = mysql

xmlstarlet returning the value of the first node only

最后都变了- 提交于 2019-12-13 07:39:44
问题 When running like this $ xmlstarlet sel -t -v '//department[@id="123879"]/user/@name' -n file.xml it returns only the first user's name T:106603 and an empty line. Here is the related XML code inside a file called file.xml (for testing purposes): <config name="department" version="1.11"> <xad version="1459" nocheckoutver="1701"> <!-- ... --> <department name="/fighters" id="123879" group="channel" case="none" use="no"> <replication region="4334"> <options index_name="index.html" listing="0"

VBA DOM Variable Attribute in XPath

倖福魔咒の 提交于 2019-12-13 07:25:19
问题 I have a program that searches for and gathers (via array) a specific author and their 'BookType' and 'BookTitle' I am now trying to learn how to use the author's name - that I've stored in an array - as a variable in the XPath to get the 'Store Location'. The biggest obstacle now is that the location only uses the author's last name. So I can split the string and all, but how would I feed it back into the XPath? Below you'll see that <PublishedAuthor id='LASTNAME'> as opposed to their full

Memory crash using [CXMLNode nodesForXPath] with namespace mappings

南楼画角 提交于 2019-12-13 07:24:21
问题 I'm trying to parse some XML in objective-c, using the TouchXML library. The XML has a namespace in the root element, so I'm using the method in the TouchXML library on the CXMLNode object like: - (NSArray *)nodesForXPath:(NSString *)xpath namespaceMappings:(NSDictionary *)inNamespaceMappings error:(NSError **)error; My code uses this method to select a bunch of nodes matching an XPath query, then for each node I do some more XPath queries to read a few properties. For some reason, the second

Mapping web form data to repeated XML elements

泄露秘密 提交于 2019-12-13 07:08:28
问题 I have gone all over the web looking for an answer to this, and have not been able to find one anywhere. I'm trying to build a web form that uses XSLT to generate XML data. I'm basing it on other forms that do the same thing, and have gotten small test structures to work fine. However, I am running into all sorts of problems when I try to map it to repeated elements. Here's a quick overview of what I have. I have an XSLT file that looks similar to this (disclaimer: lines excluded for brevity;