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