xml-parsing

How to trim spaces in xml tags using regular expression in notepad++?

随声附和 提交于 2019-12-04 16:22:51
I am trying to trim a space in an XML tag, this is an example of what I have: <xmlT ag> content between tag </xmlTa g> to: <xmlTag> content between tag </xmlTag> This is the expression that I wrote for that: Find: [<](\w)* (\w)*[>]|[<][/](\w)* (\w)*[>] Replace: \1\2 but is not working as expected. Is there any other workaround for this? If the tags only have one space in them and no attributes, this will work find: <(/?)(\w*) (\w*)> replace: <\1\2\3> Using a LookAhead we can repair any number of spaces in a tag: Search for: \s+(?=[\s\w]*>) Replace with nothing Explained demo here: http://www

limit imposed by the application while parsing XML

只愿长相守 提交于 2019-12-04 16:02:25
I'm parsing a huge XML file using eclipse juno. It parses few lines of it and then it generates the following exception: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; The parser has encountered more than "64,000" entity expansions in this document; this is the limit imposed by the application. What should I do now? One of the solution that comes into my mind is to split my XML into multiple small XML files but i can't find any solution to do that too. You can see my code here Any help would be appreciated. Thanks 来源: https://stackoverflow.com/questions/29360962/limit-imposed

Use pugiXML to rename nodes based on a std::map

社会主义新天地 提交于 2019-12-04 15:39:01
I'm new to C++ but I am trying to define a standard set of node names and then map to them. For example my standard import / output schema is this: <data> <entry> <id>1</id> <description>Test</description> </entry> </data> However sometimes my XML import will be named differently so I want to create a map so it still outputs in the above format, even if the input file has this naming convention: <data> <entry> <id>1</id> <content>Test</content> </entry> </data> This code is my best guess based on the documentation and help I've got, but I have got stuck in trying to complete it: #include "pugi

Regex VBA Match

久未见 提交于 2019-12-04 15:21:07
How can i get the value 81.16 in second msgbox? Regex get only numeric values from string Sub Tests() Const strTest As String = "<td align=""right"">116.83<span class=""up2""></span><br>81.16<span class=""dn2""></span></td>" RE6 strTest End Sub Function RE6(strData As String) As String Dim RE As Object, REMatches As Object Set RE = CreateObject("vbscript.regexp") With RE ' .MultiLine = True '.Global = False .Pattern = "\b[\d.]+\b" End With Set REMatches = RE.Execute(strData) MsgBox REMatches(0) MsgBox REMatches(1) 'getting error here End Function First of all, try not to use RegEx to parse any

How can I efficiently parse 200,000 XML files in Java?

流过昼夜 提交于 2019-12-04 14:48:11
I have 200,000 XML files I want to parse and store in a database. Here is an example of one: https://gist.github.com/902292 This is about as complex as the XML files get. This will also run on a small VPS (Linode) so memory is tight. What I am wondering is: 1) Should I use a DOM or SAX parser? DOM seems easier and faster since each XML is small. 2) Where is a simple tutorial on said parser? (DOM or SAX) Thanks EDIT I tried the DOM route even though everyone suggested SAX. Mainly because I found an "easier" tutorial for DOM and I thought that since the average file size was about 3k - 4k it

Rails 3.0 Parsing XML and Inserting into Database

北战南征 提交于 2019-12-04 14:40:46
问题 I'm new to Rails, and am trying to hook up my application to a third-party API (it does't have a gem or plugin for Rails). Ideally, what I want to be able to do is parse the data (I've heard good things about Nokogiri, but don't know how to use it for what I want to do do. not for lack of trying), and then insert it into the database. Could anybody provide instructions or point me in the right direction? Cheers. UPDATE: Rake Task: task :fetch_flyers => :environment do require 'nokogiri'

xml to r data extraction

我与影子孤独终老i 提交于 2019-12-04 14:10:42
I need to extract data from xml file and plot graphs of: depth vs timestamp. Heading should be the IFC code. I tried using xmlToList and xmlTodataframe, but I failed doing so. I need help. My xml file looks like <document> <site> <IFC_code>HONEYCR01</IFC_code> <Latitude>41.960161</Latitude> <Longitude>-90.470759</Longitude> <River>Honey Creek</River> <Road>Hwy 136, 1st Street</Road> <Town>Charlotte</Town> <from_sensor_to_river_bottom>9.35</from_sensor_to_river_bottom> <Unit>foot</Unit> </site> <data> <value> <timestamp>2012-05-17 15:30:03-05</timestamp> <depth>8.53</depth> </value> <value>

XML RPC for android - Unable to create the XML parse: org.xml.sax.SaxNotRecognizedException

雨燕双飞 提交于 2019-12-04 13:10:03
My question is exactly this question, only the answer doesn't cut it for me. The answer simply points to this discussion. The root of the problem there is obviously the same as in the linked SO question, but I don't see how I can apply the workaround mentioned by the end of the thread to my problem. So the question is: How do I go about to avoid this error in the XML-RPC case - the one described in the linked SO-question A possible fix is to prevent apache xml-rpc from setting these features. As these settings are unsupported anyway it shouldn't be a problem (works fine for me). In version 3.1

XQuery nested return flower

不羁的心 提交于 2019-12-04 12:23:54
I'm stuck with a seemingly simple XQuery exercise. Below a piece of the XML file. <Ships> <Class name = "Kongo" type = "bc" country = "Japan" numGuns = "8" bore = "14" displacement = "32000"> <Ship name = "Kongo" launched = "1913" /> <Ship name = "Hiei" launched = "1914" /> <Ship name = "Kirishima" launched = "1915"> <Battle outcome = "sunk">Guadalcanal</Battle> </Ship> <Ship name = "Haruna" launched = "1915" /> </Class> </Ships> I'm trying to transform the XML into an XHTML with the Class name attributes (Kongo) as header and an enumerated list of the child ship names and launch-years: <h1

Parse a xml file using c++ & Qt

送分小仙女□ 提交于 2019-12-04 12:14:06
问题 I try to parse a XML-file with the following structure: <I> <C c="test1"> <H><Pd pd="123"/> <f p="789" r="456"/> </H> <M m="test2"> <H><Pd pd="3456"/><R r="678"/> </H> </M> </C> <T t="0"> <T2>123</T2> <T3>2345</T3> </T> <T t="1"> <T1>23456</T1> <T2>23</T2> <T3>123</T3> <T4>456</T4> </T> </I> I have a List of numbers e.g. 0 and 1 and a search pattern e.g. '23' Now i want to search the XML-file for all T-nodes with t="a number from my list" where one of the child nodes(T1, T2,T3) contain the