XML : testng.xml is not executed from batch file

I've read many tutorials and threads, but cannot resolve my problem. I'm getting "Could not find or load main class org.testng.TestNG" error all the time and can't find solution.

That's how my project structure looks like:

That's my .xml file code:

  <?xml version="1.0" encoding="UTF-8"?>  <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">  <suite name="Suite" parallel="false">  <test name="Test">  <classes>    <class name="olatest_2.rejestracja"/>    <class name="olatest_2.logowanie"/>  </classes>  </test> <!-- Test -->  </suite> <!-- Suite -->    

I've tried different ways of composing my .bat file, but none of the works.

  set projectLocation=C:\ENVIRONMENT\eclipse\WORKSPACE\PZW_2  cd %projectLocation%  set classpath=%projectLocation%\bin  java org.testng.TestNG %projectLocation%\testng.xml  pause    
Read more ...

XML : Convert XML data into tsql record for any XML response

I don't know if it has already been answered, but my bad luck or so I can't find it anywhere in stackoverflow with my hunting techniques. Kindly ignore my spamming

We have a requirement where we need to write a API parser that works for any API giving XML output.

We will not know the XML structure before hand.

The solution should convert XML file and save it in a generic tsql table with the XML element/attribute names as first row.

So basically it is XML deserializer for any API.

We cannot use any third party dll for our C# class.

I have no idea about C# so dont know if it is possible or not. But I have been able to write a genric XML->row converter in tsql using OPENXML. The problem with tsql solution is that we are unable to import a huge XML file succesfully into database.

I can supply any details that will be required. Kindly let me know in comments/answers.

Read more ...

XML : List inside Java XML Properties

I want to store a list of key-value pairs as values to specific key in a properties xml file.

Consider following example:

  <?xml version="1.0" encoding="UTF-8" standalone="no"?>  <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">  <properties>      <entry key="led.color">         <color key="r">0</color>         <color key="g">100</color>         <color key="b">0</color>      </entry>  </properties>    

My initial approach was to retrieve the value of led.color as String and convert it to a Map. But the retrival failed with following exception:

  Caused by: org.xml.sax.SAXParseException; lineNumber: 22; columnNumber: 20; Element type "color" must be declared.    

This happens because color is not declared in the DTD and hence, the validation fails.

Is there any build-in way to handle such task or a way to avoid the vaildation of this specific value?

Read more ...

XML : Add elements when iterating over XML via jquery

I have an XML feed that I am parsing using ajax and jquery. This works fine, but what is a way I can add a div for every 3 nodes found - or any other number?

Want to wrap every 3 items I find in a div.

Read more ...

XML : How to use xmltodict to get items out of an xml file

I am trying to easily access values from an xml file.

  <artikelen>      <artikel nummer="121">          <code>ABC123</code>          <naam>Highlight pen</naam>          <voorraad>231</voorraad>          <prijs>0.56</prijs>      </artikel>      <artikel nummer="123">          <code>PQR678</code>          <naam>Nietmachine</naam>          <voorraad>587</voorraad>          <prijs>9.99</prijs>      </artikel>  ..... etc    

If i want to acces the value ABC123, how do I get it?

  import xmltodict    with open('8_1.html') as fd:      doc = xmltodict.parse(fd.read())      print(doc[fd]['code'])    
Read more ...

XML : How to create a new table after reaching a height in xsl?

I have xml file like:

  <lines>     <line>         <id>1</id>         <value>1</value>      </line>     <line>         <id>2</id>         <value>2</value>      </line>     <line>         <id>3</id>         <value>3</value>      </line>     <line>         <id>4</id>         <value>4</value>      </line>     <line>         <id>5</id>         <value>5</value>      </line>     <line>         <id>6</id>         <value>6</value>      </line>     <line>         <id>7</id>         <value>7</value>      </line>     <line>         <id>8</id>         <value>8</value>      </line>  <lines>    

and my xslt file:

  <?xml version="1.0" encoding="UTF-8"?>  <xsl:stylesheet version="1.0"      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  <xsl:template match="/">  <html>  <body>    <table border="1">      <xsl:for-each select="lines/line">      <tr>         <td><xsl:value-of select="id"/></td>         <td><xsl:value-of select="value"/></td>     </tr>    </xsl:for-each>  </table>  </body>  </html>  </xsl:template>    

My question is, how can I divide this xml nodes due to a table height? For example, after table reaches 100px, then close table tag and create new table and add tr tag to this new table?

How can I succeed this? I tried for row count but sometimes text in xml can be very large. So, I want to descrease row number of table.

Any help?

Read more ...

XML : R- Parallel Processing taking too much time

i'm running a R script which reads in the values from different(128) Excel sheet(Typically each ranging from 4MB-16MB). The R Script uses a Parallel processing method using Foreach loop wherein it converts the values into respective XML files (in total 128 XMlfiles needs to be generated).

I ran that Script file but it's been 2 days and i got the output for only 12 files.

I would be of great help if anyone can assist me with this as it's quite urgent.

Read more ...