xml

Ruby to_xml with repeating same nodes

ⅰ亾dé卋堺 提交于 2021-02-11 14:35:34
问题 I would like to generate something like: <?xml version=\"1.0\" encoding=\"UTF-8\"?> <Test> <Car> <engine>A</engine> <wheels>4</wheels> </Car> <Car> <engine>B</engine> <wheels>2</wheels> </Car> </Test> but doing: {"Car"=>[{"engine"=>"A", "wheels"=>"4"}, {"engine"=>"B", "wheels"=>"2"}]}.to_xml(:root => "Test") returns: <?xml version=\"1.0\" encoding=\"UTF-8\"?> <Test> <Car type=\"array\"> <Car> <engine>A</engine> <wheels>4</wheels> </Car> <Car> <engine>B</engine> <wheels>2</wheels> </Car> </Car

XSLT select the second occurrence of an attribute

瘦欲@ 提交于 2021-02-11 14:34:18
问题 Is there a dynamic way to get the 2nd occurrence of an attribute ? For this XML example, I'd like to get the first 12 values of the SummaryCell/@Name value into a variable Month01, Month02, and so on; <SummaryHeader> <SummaryColumnGroup Name="2014"> <SummaryCell Name="Feb14" Type="Text" Value="Feb"/> <SummaryCell Name="Jan14" Type="Text" Value="Jan"/> </SummaryColumnGroup> <SummaryColumnGroup Name="2013"> <SummaryCell Name="Dec13" Type="Text" Value="Dec"/> <SummaryCell Name="Nov13" Type="Text

BeautifulSoup parsing XML to table

时光怂恿深爱的人放手 提交于 2021-02-11 14:34:03
问题 come back again with another issue. using BeautifulSoup really new in parsing XML , and have this problem since 2 weeks now. will appreciate your help have this structure : <detail> <page number="01"> <Bloc code="AF" A="000000000002550" B="000000000002550"/> <Bloc code="AH" A="000000000035826" C="000000000035826" D="000000000035826"/> <Bloc code="AR" A="000000000026935" B="000000000024503" C="000000000002431" D="000000000001669"/> </page> <page number="02"> <Bloc code="DA" A="000000000038486"

How to add data to testcase with JUnit and Maven Surefire Plugin

…衆ロ難τιáo~ 提交于 2021-02-11 14:27:30
问题 I have a running maven project with JUnit tests. The Maven Surefire Plugin drops xml files after the tests. These xml files include, besides properties and logprints, following information: <testcase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="methodNameForTest" classname="com.my.test.project.Testclass" time="20.931"> <error type="java.lang.NullPointerException">java.lang.NullPointerException</error> </testcase> Can someone explain me the usual way how data gets written from

how to print XML documents to the REPL console when using ConvertTo-Xml in Powershell?

此生再无相见时 提交于 2021-02-11 14:25:27
问题 "almost" printing the elements to the console: PS /home/nicholas/flwor> PS /home/nicholas/flwor> $nodes = Select-Xml "/" $xml PS /home/nicholas/flwor> PS /home/nicholas/flwor> $nodes Node Path Pattern ---- ---- ------- #document InputStream / PS /home/nicholas/flwor> not quite sure how print the actual node values. for larger context,reading in a file and converting it to xml as: PS /home/nicholas/flwor> PS /home/nicholas/flwor> $xml=./bookstore.xml PS /home/nicholas/flwor> PS /home/nicholas

JAXB / Java 11 / Tomcat - DataHandler No default constructor

百般思念 提交于 2021-02-11 14:23:14
问题 I have some trouble with JAXB, i found out that it exists many implementations of it, i used JBoss and the code worked well (Metro JAXB), now with tomcat and com.sun.xml.bind.. it doesn't, it cannot convert the Base64 encoded String into a DataHandler. Now i recompiled it again and i'm trying if the @XMLAttachmentRef would solve my trouble. [com.sun.xml.bind.v2.ClassFactory] No default constructor found on class javax.activation.DataHandler java.lang.NoSuchMethodException: javax.activation

Why does Firefox show: XML Parsing Error: junk after document element?

限于喜欢 提交于 2021-02-11 14:22:57
问题 Error: yet from the console, desired output: nicholas@mordor:~$ nicholas@mordor:~$ curl http://localhost:8080/exist/rest/db/scripts/notes.xq <notes> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> <note> foo </note> <note> bar </note> </notes> <notes> <note> foo </note> <note> bar </note> <note> baz </note> </notes>nicholas@mordor:~$ nicholas@mordor:~$ nicholas@mordor:~$ lynx http://localhost:8080/exist/rest/db/scripts

how to include the value of position() in an Xquery result?

六月ゝ 毕业季﹏ 提交于 2021-02-11 14:22:48
问题 Without using tumbling windows, how is the position itself included in a result? Obviously "$p" should be the "index" of each $item in $items. That being said, iteration isn't guaranteed to be sequential at all. output: <result> <items> <item pos="$p">5</item> <item pos="$p">3</item> <item pos="$p">7</item> <item pos="$p">2</item> <item pos="$p">7</item> <item pos="$p">3</item> </items> </result> query: xquery version "3.1"; let $items := (5,3,7,2,7,3) return <result> <items> { for $item in

Reading local text file as XML

Deadly 提交于 2021-02-11 14:19:00
问题 I'm attempting to read local file (that user inputted) as xml. Following code stright up fails due to the fact that global 'xml' variable remains null in all other scopes. Not sure why considering there's no local variable named 'xml'. Unless user changes the file in which case 'xml' variable is a proper xml document. I'm also confused by alert order. How do FileReader() and DomParser() actually behave? var xml = null; //global function readFile(object) { //object is document.getElementById(

What is the difference between namespace and prefix in XML?

痞子三分冷 提交于 2021-02-11 14:14:23
问题 I am forced to fight with an external XML and I do not understand what is the difference between namespace and prefix in a XML file. I mean, I am using namespace and name of the label to get a value in this file with Linq library. But I do not know the difference between these. -<a:RoutePointsMeteoData z:Id="31" z:Size="10"> -<b:anyType z:Id="32" i:type="a:WaypointFLMeteoData"> <a:DevISA>0</a:DevISA> <a:DisplayTemperatureType>IsaDev</a:DisplayTemperatureType> <a:RelatedRoutePointName