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 ...

XML : Error while creating XML document in PHP

I got this error while trying to create XML document from database data:

error on line 2 at column 1: Extra content at the end of the document

Here's my code:

  <?php  header('Content-type: text/xml');    $mysqli = new mysqli('127.0.0.1', 'root', '', 'db_test');    $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><root></root>');    $currency = $xml->addChild('currency');  $currency->addAttribute('rate', '8');  $currency->addAttribute('code', 'PLZ');    $catalog = $xml->addChild('catalog');  $items = $xml->addChild('items');    $result = $mysqli->query("SELECT * FROM `catalog`");  while($it = $result->fetch_object()) {      $item = $items->addChild('item');      $item->addAttribute('id', $it->id);      $item->addAttribute('selling_type', "r");      $item->addChild('name', $it->name.", ".$it->comment);      $item->addChild('categoryId', $it->parent_id);      $item->addChild('priceplz', $it->cost);            $r = $mysqli->query("SELECT `image` FROM `catalog_images` WHERE `catalog_id`='".$it->id."' AND `main`=1 LIMIT 1");      if($i = $r->fetch_object()){        $item->addChild('image', "/Media/images/catalog/big/".$i->image);      }      unset($r);      unset($i);        $item->addChild('barcode', $it->artikul);      $item->addChild('description', $it->text);      $item->addChild('available', "true");      unset($item);  }  unset($result);  unset($it);    $result = $mysqli->query("SELECT * FROM `catalog_tree`");  while($cat = $result->fetch_object()) {      $category = $catalog->addChild('category', $cat->name);      $category->addAttribute('id', $cat->id);      if($cat->parent_id != 0) {          $category->addAttribute('portal_id', $cat->id);          $category->addAttribute('parentId', $cat->parent_id);      }      unset($category);  }  unset($result);  unset($cat);    $mysqli->close();    $xml->asXML('text.xml');    ?>    

If I'll comment the 'items' loop it works fine, otherwise it doesn't work... Am I blind or what?

Read more ...

XML : Creating a dynamic datsource with xml files

Is it possible to create a dynamic datasource in Java JEE web application using multiple XML files full of data?.

And how will i accomplish this?

More Info : I have all files stored in db using JPA. Getting these are easy. I want to take example all files in the last month and convert it to a datasource the do queries etc on that datasource. Using Payara as a container .

I Dont want to loop over the files input stream nor save the data of xml . Xml files are +- 200MB of size .

I Saw this post Dynamic Data Site with XML file . But its not helping

Thanks in advance.

Read more ...

XML : background color and images are not printing through IE11

background color and images are not printing through IE11

Following are shared url which contain code https://drive.google.com/open?id=0B-TX4J3x_xI8QURsZG5Ld1VVd0k

Read more ...

XML : Converting multiple rows to single XML row. - SQL Server

I have one table in following format. enter image description here

I want data in XML format per Employee as below

  <Employee>    <EmployeeID>1</EmployeeID>    <FirstName>Jon</FirstName>    <LastName>Snow</LastName>    <City>North of the wall</City>    <Age>28</Age>    <Gender>Male</Male>  </Employee>    <Employee>    <EmployeeID>2</EmployeeID>    <FirstName>Arya</FirstName>    <LastName>Stark</LastName>    <City>Winterfell</City>    <Age>14</Age>    <Gender>Female</Male>  </Employee>    
Read more ...

XML : Complex Type definition gives a unique particle violation error

The given definition of the type MyType should allow the element sequences A; B; C; A, B and A, C. On validation I get an "unique particle violation" error. How can I fix this issue?

  <xs:complexType name="MyType">    <xs:choice>      <xs:element name="A" type="AType"/>      <xs:sequence>        <xs:element name="A" type="AType" minOccurs="0"/>        <xs:choice>          <xs:element name="B" type="BType"/>          <xs:element name="C" type="CType"/>        </xs:choice>      </xs:sequence>    </xs:choice>  </xs:complexType>    
Read more ...

XML : CORS post index file with XML call

I have some Ajax that makes a Cross Origin Resource call

   $("#inductive1").click(function (event) {      $.post(         "https://www.mysite.co.uk/folder/tests/Inductive/Test1/index.phtml",          function (data) {              $('.stage2').html(data);          }      );  });    

within the index.phtml file I have some Script that calls exam.xml

Script inside index.phtml

  ( function($, undefined) {                $(function() {                    var test = new Test({                        testName: "Inductive Test 1",                      dataURL : "/getresultshtml.php",                      sendEmailURL: "/sendresultsbyemail.php",                      contentFolder : "./",                      solutionURL: "../../../content/f/id/10/",                      userID: 0,                      courseItemID: 25,                      XMLFile: "exam.xml",                      isStandalone: false                  });                    test.start();                });          }(jQuery));    

However the xml file is trying to be called from the other server,

EG

  https://server1.com/exam.xml    

it should be

  https://myserver.com/exam.xml    

I have tried changing the JS to direct path as in

   XMLFile: "htttps:/myserver.com/exam.xml"    

but it is being read as

  https://server1.com/myserver.com/exam.xml    

how do I change the javascript so that it changes the root URL to myserver.com and not server1.com

Read more ...

XML : XSLT not working with my XML

Hi my XSL doesn't seem to be working with my XML. I can't seem to figure out the problem even though my code is quite simple. My XML sheet seems to transform into just raw Data when i link to the XSL spreadsheet and open the document.

My XSL

  <?xml version="1.0" encoding="UTF-8"?>  <xsl:stylesheet version="1.0"   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">    <xsl:output method="html"/>    <xsl:template match="/">   <html>  <head>    <title>Room Information</title>  </head>  <body>    <h1>Room information</h1>     <table border="1">     <tr bgcolor="#9acd32">      <th>TITLE</th>      <th>ACCOMODATION</th>      <th>COST</th>      <th>LEVEL</th>      <th>VIEW</th>      <th>ENSUITE</th>      <th>MAID_SERVICE</th>      <th>ROOM_SERVICE</th>      <th>LAUNDRY_SHOOT</th>      <th>ROOM_IMAGE</th>      <th>PAST_CUSTOMERS</th>     </tr>  <xsl:for-each select="ROOMS/ROOM">              <tr>                  <td><xsl:value-of select="TITLE"/></td>                  <td><xsl:value-of select="ACCOMODATION"/></td>                  <td><xsl:value-of select="COST"/></td>                  <td><xsl:value-of select="LEVEL"/></td>                  <td><xsl:value-of select="VIEW"/></td>                  <td><xsl:value-of select="ENSUITE"/></td>                  <td><xsl:value-of select="MAID_SERVICE"/></td>                  <td><xsl:value-of select="ROOM_SERVICE"/></td>                  <td><xsl:value-of select="LAUNDRY_SHOOT"/></td>                  <td><xsl:value-of select="ROOM_IMAGE"/></td>                  <td><xsl:value-of select="PAST_CUSTOMERS"/></td>              </tr>    </xsl:for-each>    

This is my XML (The DTD can just be ignored)

  ?xml version="1.0" encoding="UTF-8"?>  <?xml-stylesheet type="text/xsl" href="XSL/RoomsXSL.xsl"?>    <!DOCTYPE ROOMS [  <!ELEMENT ROOM (TITLE+,ACCOMODATION,COST,LEVEL+,VIEW,ENSUITE,MAID_SERVICE,ROOM_SERVICE,LAUNDRY_SHOOT,ROOM_IMAGE+,PAST_CUSTOMERS+)>  <!ELEMENT TITLE (#PCDATA)>  <!ELEMENT ACCOMODATION (#PCDATA)>  <!ELEMENT COST (#PCDATA)>  <!ELEMENT LEVEL (#PCDATA)>  <!ELEMENT VIEW (#PCDATA)>  <!ELEMENT ENSUITE (#PCDATA)>  <!ELEMENT MAID_SERVICE (#PCDATA)>  <!ELEMENT ROOM_SERVICE (#PCDATA)>  <!ELEMENT LAUNDRY_SHOOT (#PCDATA)>  <!ELEMENT ROOM_IMAGE (#PCDATA)>  <!ELEMENT PAST_CUSIMERS (#PCDATA)>    <!ENTITY writer "Dylan Weiss">  <!ENTITY copyright "Horizon BnB">  ]>    <ROOMS>    <ROOM id="01">      <TITLE>Top Floor 1</TITLE>      <ACCOMODATION>Accomodates 2 people</ACCOMODATION>      <COST>$700 a week.$120 every day over a week</COST>      <LEVEL>Top floor</LEVEL>      <VIEW>Includes panoramic View</VIEW>      <ENSUITE>Has ensuite</ENSUITE>      <MAID_SERVICE>Maid service included</MAID_SERVICE>      <ROOM_SERVICE>Includes room service</ROOM_SERVICE>      <LAUNDRY_SHOOT>Includes laundry shoot</LAUNDRY_SHOOT>      <ROOM_IMAGE>Images/LuxuryRoom1.jpg</ROOM_IMAGE>      <PAST_CUSTOMERS>WWW.Horizon/PastCustomers.com</PAST_CUSTOMERS>    </ROOM>      <ROOM id="02">      <TITLE>Bottom floor 1</TITLE>      <ACCOMODATION>Accomodates 2 people</ACCOMODATION>      <COST>$500 a week.$100 every day over a week</COST>      <LEVEL>Ground floor</LEVEL>      <VIEW>Includes a courtyard</VIEW>      <ENSUITE>Has ensuite</ENSUITE>      <MAID_SERVICE>Maid service included</MAID_SERVICE>      <ROOM_SERVICE>Includes room service</ROOM_SERVICE>      <LAUNDRY_SHOOT>No laundry shoot</LAUNDRY_SHOOT>      <ROOM_IMAGE>Images/LuxuryRoom1.jpg</ROOM_IMAGE>      <PAST_CUSTOMERS>WWW.Horizon/PastCustomers.com</PAST_CUSTOMERS>    </ROOM>      <ROOM id="03">      <TITLE>Bottom floor 2</TITLE>      <ACCOMODATION>Accomodates 4 people</ACCOMODATION>      <COST>$800 a week.$120 every day over a week</COST>      <LEVEL>Ground floor</LEVEL>      <VIEW>Includes a courtyard</VIEW>      <ENSUITE>Has ensuite</ENSUITE>      <MAID_SERVICE>Maid service included</MAID_SERVICE>      <ROOM_SERVICE>Includes room service</ROOM_SERVICE>      <LAUNDRY_SHOOT>No laundry shoot</LAUNDRY_SHOOT>      <ROOM_IMAGE>Images/LuxuryRoom1.jpg</ROOM_IMAGE>      <PAST_CUSTOMERS>WWW.Horizon/PastCustomers.com</PAST_CUSTOMERS>    </ROOM>  </ROOMS>    
Read more ...

XML : Convert XML from one format to another

I have this below xml data which is stored in a table.

The XML Structure I have

  <Response>      <Question ID="1">          <Value ID="1">I want a completely natural childbirth - no medical interventions for me</Value>          <Value ID="2">no medical interventions for me</Value>      </Question>  </Response>    

I need to convert this XML to a slightly different format, like the below one.

The XML Structure I need

  <Response>      <Question ID="1">          <SelectedChoices>              <Choice>                  <ID>1</ID>              </Choice>              <Choice>                  <ID>2</ID>              </Choice>          </SelectedChoices>      </Question>  </Response>    

Here the "Value" is changed to "Choice" and "ID" attribute of "Value" element is changed to an element.

I know this can be done in other ways, like using an XSLT. But it will be much more helpful if can accomplish with SQL itself.

Can someone help me to convert this using SQL?

Read more ...

XML : Using @Nonnull with JAXB

I'm using @NonNull for a JAXB'd xml object, simplified example below:

  Public class MyXML  {      @Nonnull      public Double myNumber;        public MyXML() { }  //Required for JAXB  }    

However, my IDE (Eclipse) displays the following warning on the constructor:

The @NonNull field myNumber may not have been initialized

Which makes sense as it stands.

How can I make use of @Nonnull (which is very useful) alongside JAXB without this warning appearing?

I don't want to just @surpress it away.
I can't give the myNumber a default value, as it shouldn't have one. I'd like it to throw an exception rather than create the object. I can't validate myNumber in the constructor, as it's already too late by this point.

All advice appreciated!

Greg

Read more ...

XML : thoughts required on XSD versioning

Need your view on XSD . I have created an XSD now which has to be published with the organisation . The debate is how do we maintain the versioning .

There will be two different stacks that will use this XSD. How can we identify which version of XSD have they used to generate the XML ?

Also how can we avoid garbage values in the XML tag?

Read more ...

XML : XQuery: Querying all instances of a certain tag?

I am querying an xml document that has changed structure, previously there was only one tag but this has changed to have multiple.

How can I return all the "id" values in the attribute tags?

XML:

  <Products>          <Product>              <name>Sample name</name>              <attribute id="sampleid1" location="sampleLocation1" type="sampleType1"/>              <attribute id="sampleid2" location="sampleLocation2" type="sampleType2"/>          </product>      </Products>     

Current Query (will only return the id of one Attribute):

  format("//Products/Product[name='%s']/attribute/@id/string()"    

The query shown above would return e.g. "sampleId1" when there was only one attribute.

Now that there are more than one attributes how can I query for all attribute Ids, i.e. in this case to return "sampleId1" and "sampleId2" ?

Read more ...

XML : how to keep my navigation drawer always on top of everything? ANDROID

is there any way to keep my navigation bar on top of everything or overlay or overlap on everything in my activity?

I have this code in my main_activity.xml

  <android.support.v4.widget.DrawerLayout      android:layout_width="match_parent"      android:layout_height="0dp"      android:id="@+id/drawer_layout"      android:layout_weight="1"      >      <FrameLayout          android:layout_width="match_parent"          android:layout_height="match_parent"          android:id="@+id/frame_container"          >      </FrameLayout>        <android.support.v4.view.ViewPager          android:id="@+id/pager"          android:layout_width="match_parent"          android:layout_height="0dp"          android:layout_weight="1"          />        <!-- Listview to display slider menu -->      <ListView          android:id="@+id/list_slidermenu"          android:layout_width="240dp"          android:layout_height="match_parent"          android:layout_gravity="start"          android:choiceMode="singleChoice"          android:listSelector="@drawable/list_selector"          android:background="#FFF"/>    </android.support.v4.widget.DrawerLayout>    <android.support.design.widget.TabLayout      android:id="@+id/tab_layout"      android:layout_width="match_parent"      android:layout_height="wrap_content"      android:background="#FFF"      android:minHeight="?attr/actionBarSize"      app:tabIndicatorHeight="5dp"      app:tabIndicatorColor="@color/colorPrimary"      />    </LinearLayout>    

The problem I have now is that my tablayout will show all the time even I have show my navigation drawer. Anyone know how to help me with this?

Your answer will be appreciated.

Read more ...

XML : Remove iframe from Blogspot ecommerce template

I want to use a free Blogspot Ecommerce template for my small online shopping site (source of free blogspot ecommerce templates : http://www.techclient.com/ecommerce-blogger-templates/). On the footer of each blogspot page, I find this :

Footer area found

Need help to remove this item. Please help.

Read more ...