Problem in XSD and XSLT

Actually I have a problem relating to Oracle 10g XML DB. I’ll explain the scenario.
1.     First an xml file needs to be loaded into the database( after registering the schema)
2.     Later maybe after inserting suppose 10 xml files into the table, I need to add an element in the xml.
3. And the new xml's which are later loaded will have that additional field coming in. so how should I go about from here.
What I’ve thought is:
1.     Generate a new XSD schema (don’t know how to generate this automatically), implementing the additional field change.(can u help me in this)
2.     Create a new XSL depending on the new XSD schema (don’t know how to generate this automatically). (can u help me in this)
3.     apply the new xsl to the original xml to get the new xml.
4.     in the meantime, keep the old xml in a temporary tables, and later, update those xml corresponding to the new schema (can u help me in this)
I don’t know if this a correct procedure, if in case, there is a different and an easy method to do it, please let me know.
regards,
athar

Does the following help
SQL> set long 10000 pages 50
SQL> --
SQL> declare
  2    res boolean;
  3    xmlschema xmltype := xmltype(
  4  '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://x
  5     <xsd:complexType name="T_person" xdb:SQLType="PERSON_T">
  6       <xsd:all>
  7         <xsd:element name="first_name" type="xsd:string" />
  8         <xsd:element name="last_name" type="xsd:string" />
  9         <xsd:element name="birth_day" type="xsd:date" />
10       </xsd:all>
11       <xsd:attribute name="employee_id" type="xsd:positiveInteger" />
12     </xsd:complexType>
13     <xsd:element name="person" type="T_person" xdb:defaultTable="XML_LOAD"/>
14  </xsd:schema>');
15  begin
16    if (dbms_xdb.existsResource('/public/testcase.xsd')) then
17      dbms_xdb.deleteResource('/public/testcase.xsd');
18    end if;
19    res := dbms_xdb.createResource('/public/testcase.xsd',xmlschema);
20  end;
21  /
PL/SQL procedure successfully completed.
SQL> call dbms_xmlschema.deleteSchema('www.WMDurl.com',4)
  2  /
Call completed.
SQL> begin
  2    dbms_xmlschema.registerSchema ('www.WMDurl.com',xdburitype('/public/testcas
  3  end;
  4  /
PL/SQL procedure successfully completed.
SQL> desc XML_LOAD
Name                                      Null?    Type
TABLE of SYS.XMLTYPE(XMLSchema "www.WMDurl.com" Element "person") STORAGE Object-r
SQL> --
SQL> desc PERSON_T
PERSON_T is NOT FINAL
Name                                      Null?    Type
SYS_XDBPD$                                         XDB.XDB$RAW_LIST_T
employee_id                                        NUMBER(38)
first_name                                         VARCHAR2(4000 CHAR)
last_name                                          VARCHAR2(4000 CHAR)
birth_day                                          DATE
SQL> --
SQL> insert into xml_load values (xmltype(
  2  '<person employee_id="1">
  3     <first_name>mark</first_name>
  4     <last_name>drake</last_name>
  5     <birth_day>2006-01-31</birth_day>
  6   </person>'
  7  ))
  8  /
1 row created.
SQL> commit
  2  /
Commit complete.
SQL> set long 10000
SQL> --
SQL> select * from xml_load
  2  /
SYS_NC_ROWINFO$
<person employee_id="1">
  <first_name>mark</first_name>
  <last_name>drake</last_name>
  <birth_day>2006-01-31</birth_day>
</person>
SQL> insert into xml_load values (xmltype(
  2  '<person employee_id="1">
  3     <first_name>barney</first_name>
  4     <last_name>rubble</last_name>
  5     <birth_day>2006-01-31</birth_day>
  6     <address>Bedrock</address>
  7   </person>'
  8  ))
  9  /
insert into xml_load values (xmltype(
ERROR at line 1:
ORA-30937: No schema definition for 'address' (namespace '##local') in parent
'/person'
SQL> commit
  2  /
Commit complete.
SQL> set long 10000
SQL> --
SQL> select * from xml_load
  2  /
SYS_NC_ROWINFO$
<person employee_id="1">
  <first_name>mark</first_name>
  <last_name>drake</last_name>
  <birth_day>2006-01-31</birth_day>
</person>
SQL> select xdbUriType('/public/testcase.xsd').getXML()
  2    from dual
  3  /
XDBURITYPE('/PUBLIC/TESTCASE.XSD').GETXML()
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns
.oracle.com/xdb">
  <xsd:complexType name="T_person" xdb:SQLType="PERSON_T">
    <xsd:all>
      <xsd:element name="first_name" type="xsd:string"/>
      <xsd:element name="last_name" type="xsd:string"/>
      <xsd:element name="birth_day" type="xsd:date"/>
    </xsd:all>
    <xsd:attribute name="employee_id" type="xsd:positiveInteger"/>
  </xsd:complexType>
  <xsd:element name="person" type="T_person" xdb:defaultTable="XML_LOAD"/>
</xsd:schema>
SQL> declare
  2    xmlschema xmltype := xdburitype('/public/testcase.xsd').getXML();
  3    res boolean;
  4  begin
  5    select insertChildXML
  6           (
  7             xmlschema,
  8             '/xsd:schema/xsd:complexType[@name="T_person"]/xsd:all',
  9             'xsd:element',
10             xmltype('<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema"
11             'xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
12           )
13      into xmlSchema
14      from dual;
15    if (dbms_xdb.existsResource('/public/newTestcase.xsd')) then
16      dbms_xdb.deleteResource('/public/newTestcase.xsd');
17    end if;
18    res := dbms_xdb.createResource('/public/newTestcase.xsd',xmlschema);
19  end;
20  /
PL/SQL procedure successfully completed.
SQL> select xdbUriType('/public/newTestcase.xsd').getXML()
  2    from dual
  3  /
XDBURITYPE('/PUBLIC/NEWTESTCASE.XSD').GETXML()
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns
.oracle.com/xdb">
  <xsd:complexType name="T_person" xdb:SQLType="PERSON_T">
    <xsd:all>
      <xsd:element name="first_name" type="xsd:string"/>
      <xsd:element name="last_name" type="xsd:string"/>
      <xsd:element name="birth_day" type="xsd:date"/>
      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="address" t
ype="xsd:string"/>
    </xsd:all>
    <xsd:attribute name="employee_id" type="xsd:positiveInteger"/>
  </xsd:complexType>
  <xsd:element name="person" type="T_person" xdb:defaultTable="XML_LOAD"/>
</xsd:schema>
SQL> begin
  2    dbms_xmlschema.CopyEvolve
  3    (
  4       xdb$string_list_t('www.WMDurl.com'),
  5       XMLSequenceType(xdburitype('/public/newTestcase.xsd').getXML()),
  6       null
  7    );
  8  end;
  9  /
PL/SQL procedure successfully completed.
SQL> desc XML_LOAD
Name                                      Null?    Type
TABLE of SYS.XMLTYPE(XMLSchema "www.WMDurl.com" Element "person") STORAGE Object-r
SQL> --
SQL> desc PERSON_T
PERSON_T is NOT FINAL
Name                                      Null?    Type
SYS_XDBPD$                                         XDB.XDB$RAW_LIST_T
employee_id                                        NUMBER(38)
first_name                                         VARCHAR2(4000 CHAR)
last_name                                          VARCHAR2(4000 CHAR)
birth_day                                          DATE
address                                            VARCHAR2(4000 CHAR)
SQL> --
SQL> insert into xml_load values (xmltype(
  2  '<person employee_id="2">
  3     <first_name>barney</first_name>
  4     <last_name>rubble</last_name>
  5     <birth_day>2006-01-31</birth_day>
  6     <address>Bedrock</address>
  7   </person>'
  8  ))
  9  /
1 row created.
SQL> commit
  2  /
Commit complete.
SQL> set long 10000
SQL> --
SQL> select * from xml_load
  2  /
SYS_NC_ROWINFO$
<person employee_id="1">
  <first_name>mark</first_name>
  <last_name>drake</last_name>
  <birth_day>2006-01-31</birth_day>
</person>
<person employee_id="2">
  <first_name>barney</first_name>
  <last_name>rubble</last_name>
  <birth_day>2006-01-31</birth_day>
  <address>Bedrock</address>
</person>
SQL> update XML_LOAD
  2     set object_value = insertChildXML
  3                        (
  4                          object_value,
  5                          '/person',
  6                          'address',
  7                          xmltype('<address/>')
  8                        )
  9   where existsNode(object_value,'/person/address') = 0
10  /
1 row updated.
SQL> commit
  2  /
Commit complete.
SQL> select * from xml_load
  2  /
SYS_NC_ROWINFO$
<person employee_id="1">
  <first_name>mark</first_name>
  <last_name>drake</last_name>
  <birth_day>2006-01-31</birth_day>
  <address/>
</person>
<person employee_id="2">
  <first_name>barney</first_name>
  <last_name>rubble</last_name>
  <birth_day>2006-01-31</birth_day>
  <address>Bedrock</address>
</person>

Similar Messages

  • Problem with XML and XSLT, help...

    Okay, I have this XML doc (called stocks.xml):
    <?xml:stylesheet type="text/xsl" href="stocks.xsl" version="1.0" encoding="UTF-8"?>
    <portfolio>
    <stock>
    <symbol> SUNW </symbol>
    <name> Sun Microsystem </name>
    <price> 12.95 </price>
    </stock>
    <stock>
    <symbol> HPW </symbol>
    <name> Hewlet Packard </name>
    <price> 53.50 </price>
    </portfolio>
    And I have this XSLT doc (called stocks.xls):
    ?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xls="http://www.w3.org/TR/WD-xsl">
    <xsl:template match="/">
    <html>
    <head>
    <title> Stocks </title>
    <body bgcolor="#ffffcc">
    <xsl:apply-template />
    </body>
    </head>
    </html>
    </xsl template>
    <xsl:template match="portfolio">
    <table border="2">
    <tr>
    <th> Stock Symbol </th><th> Company Name </th><th> Price </th>
    </tr>
    <xsl:for-each select="stock">
    <tr>
    <td>
    <i><xsl:value-of select="symbol" /></i>
    </td>
    <td>
    <xsl:value-of select="price" />
    </td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl template>
    </stylesheet>
    When I try to retrieve the stocks.xml document with
    IE, the browser said, there is an error on line 2, can not
    recognize xsl:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Reference to undeclared namespace prefix: 'xsl'. Error processing resource 'http://localhost:8080/examples/jsp/stocks/stocks.xsl'. Line 2, Position 71
    <xsl:stylesheet version="1.0" xmlns:xls="http://www.w3.org/TR/WD-xsl">
    I just follow this from an example of XML tutorial.
    Please help, what is it that I miss? Seems everything
    I have is okay....??
    Thanks,
    Ted.

    Thanks you all!
    You have spotted that mistyped.
    However, turns out Internet Browser that I have does not permit the use of XSL. After I fixed the file, I got this
    message:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Keyword xsl:apply-template may not be used here.
    Oh well...
    Anybody knows, if IE can or can not be used to view the
    XML that reference XSL??
    Thanks,
    Ted.

  • Problem with ECS and XSD

    Hi B2B Gurus,
    We are facing the problem with ECS and XSD files from past 2 weeks, Steps we followed
    1. Created a ECS file in document editor version 11g: 6.6.0
    2. ECS files consists only from ST and SE segments
    Ex: ST
    BCH
    CUR
    REF
    PER -- Exclude
    TAX -- Exclude
    SE
    3: Generated a XSD file from ECS file( File --> export---> Oracle B2B) in document ediotr
    4. We imported a ECS and XSD file in B2B console( documents---docdef-transaction set ECS file) and XSD File
    5. We tested one file from manually we face below error:
    Error Code B2B-51507
    Error Description Machine Info: (usmtnz-dinfap19.dev.emrsn.org) Description: Payload validation error.
    Error Level ERROR_LEVEL_COLLABORATION
    Error Severity ERROR
    Error Text
    and some times it shows Guideline load Error or simply Error
    Please help us to resolve this
    Regards

    Anuj,
    We are sending the EDI XML file from backend, then B2B will convert it into EDI file, How can we analyze EDI XML file with ECS file, B2B is not converting to EDI.
    1. Can we use 10g ECS file and XSD file in 11G
    2. I tried to import it, but it showing below error while doing testing
    App Message property     {MSG_ID=90422086, Sequencing=false, DOCTYPE_REVISION=5020, MSG_TYPE=1, FROM_PARTY=EMERSON, DOCTYPE_NAME=850, TO_PARTY=APLL, ATTACHMENT=}
    Direction     OUTBOUND
    State     MSG_ERROR
    Error Code     B2B-51507
    Error Text     Error Brief : The element does not include any significant data.
    Error Description     Error : The Element PER02 does not include any significant data characters. Segment PER is defined in the guideline at position 3600.{br}{br}This error was detected at:{br}{tab}Segment Count: 11{br}{tab}Element Count: 2{br}{tab}Characters: 5395 through 5397
    Created Date     06/20/2011 02:52 PM
    Modified Date     06/20/2011 02:52 PM
    Note: I used the same files in 10G its working fine.
    Regards
    Edited by: Francis on Jun 20, 2011 10:48 AM

  • Problem with importing XSDs and deploying to Weblogic 9.2

    Hi Guys,
    I am trying to deploy a simple web service wiith request response xsds packaged as an EAR to Weblogic 9.2
    Instead of making the request/response inline in the wsdl,I am importing it
    <message name="RequiredResponse">
    <part name="parameters" element="tns:requiredServiceResponse"/>
    </message>
    tns:http:://some.com/some
    And tns points to a valid namespace and I have made sure the xsd and wsdl are in the same folder and there are no import issues.
    When I try to start this application in Weblogic I get this error
    java.lang.IllegalArgumentException: no local element named 'parameters' on global element e=requiredServiceResponse@:http:://some.com/some
    This has no problem when deployed to Oracle App Server 10g.
    Thanks

    I have the same issue, albeit I am using WLS 10.... anyone have an answer?

  • Question about  getSpaceContents and XSLT.

    Hello everybody. Have some problems with understanding of working with getSpaceContents. I Have some *.xmls in ContentSpace and need put each of them into varaiable (to work with it in loop). How should I do it correct? The point of loop is :I have some xmls with one xsd into ContentSpace, i must to produce set of xmls (with another xsd) using xslt.First xsd looks like : Supplier, Good(unbounded) , second like : Good , Supplier(unbounded).I.e. each xmls with 1st xsd have 1 of all suppliers and list of goods, the 2nd have one of all goods and list of suppliers,corresponding to it.Could anyone give an idea , how to do it the best way? The problem is , that the information to make one of output xmls  contained in each of  input xmls.
    Thx in advance.

    upd:
    The problem of working with getSpaceContents : i made a variable doclist ( list<CRCResult> ). After getSpaceContents operation doclist looks like that :
    <list>
      <com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
        <attributeMap>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}creator</string>
            <string>usersystemcontext/DefaultDom</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}browse-link</string>
            <string>http://81.5.113.36:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/42dbbb75-abfa-43e1-96cd-b3454477d541/ID_1_Урожай.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}store-protocol</string>
            <string>workspace</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}content</string>
            <string>contentUrl=store://2010/11/17/18/54/d143cd65-1dfc-460e-88cb-1f08975ecfea.bin|mimetype=text/xml|size=3968|encoding=UTF-8|locale=en_</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}node-uuid</string>
            <string>42dbbb75-abfa-43e1-96cd-b3454477d541</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}modifier</string>
            <string>usersystemcontext/DefaultDom</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}name</string>
            <string>ID_1_Урожай.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}qualified-path</string>
            <string>/app:company_home/cm:RetailerSupplierInteraction/cm:Proposal/cm:ID_1_Урожай.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}modified</string>
            <date>2010-11-17 18:54:32.622 MSK</date>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}node-type</string>
            <string>{http://www.alfresco.org/model/content/1.0}content</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}folder-path</string>
            <string>/Company Home/RetailerSupplierInteraction/Proposal</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}created</string>
            <date>2010-08-26 12:45:12.512 MSD</date>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}store-identifier</string>
            <string>SpacesStore</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}resolved-path</string>
            <string>/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1.0}RetailerSupplierInteraction/{http://www.alfresco.org/model/content/1.0}Proposal/{http://www.alfresco.org/model/content/1.0}ID_1_Урожай.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}node-dbid</string>
            <long>629</long>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}content-type</string>
            <string>text/xml</string>
          </entry>
        </attributeMap>
        <document serialization="custom">
          <com.adobe.idp.Document>
            <int>3</int>
            <boolean>false</boolean>
            <boolean>false</boolean>
            <null/>
            <string>81.5.113.36/127.0.0.1</string>
            <null/>
            <null/>
            <null/>
            <string>IOR:000000000000002849444C3A636F6D2F61646F62652F6964702F49446F63756D656E7443616C6C6261636B3A312E30000000000200000000000000EC000102000000000C38312E352E3131332E3336000DC8000000000015353834393831363137302F01163C37231524460635000000000000050000000000000008000000004A414300000000010000001C000000000501000100000001050100010001010900000001050100010000002100000060000000000000000100000000000000240000001E0000007E00000000000000010000000C38312E352E3131332E3336000DC9004000000000000000000000001004010008060667810201010100000000000000000000000000000000000000000000002000000004000000000000001F0000000400000003000000010000002000000000000000020000002000000004000000000000001F0000000400000003</string>
            <int>82</int>
            <string>text/xml</string>
            <null/>
            <map>
              <entry>
                <string>basename</string>
                <string>ID_1_Урожай.xml</string>
              </entry>
              <entry>
                <string>file</string>
                <string>ID_1_Урожай.xml</string>
              </entry>
              <entry>
                <string>wsfilename</string>
                <string>ID_1_Урожай.xml</string>
              </entry>
            </map>
            <string>adobe/idp/DocumentPullServant/adobejb_null</string>
            <long>-1</long>
          </com.adobe.idp.Document>
        </document>
      </com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
      <com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
        <attributeMap>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}creator</string>
            <string>usersystemcontext/DefaultDom</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}browse-link</string>
            <string>http://81.5.113.36:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/0ac06777-e5ae-48ef-99d8-1ed029253987/ID_2_Три топора.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}store-protocol</string>
            <string>workspace</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}content</string>
            <string>contentUrl=store://2010/11/17/18/55/3ad2fac7-2b6e-4dae-a87a-382ca0f35fd4.bin|mimetype=text/xml|size=3979|encoding=UTF-8|locale=en_</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}node-uuid</string>
            <string>0ac06777-e5ae-48ef-99d8-1ed029253987</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}modifier</string>
            <string>usersystemcontext/DefaultDom</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}name</string>
            <string>ID_2_Три топора.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}qualified-path</string>
            <string>/app:company_home/cm:RetailerSupplierInteraction/cm:Proposal/cm:ID_2_Три_x0020_топора.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}modified</string>
            <date>2010-11-17 18:55:26.206 MSK</date>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}node-type</string>
            <string>{http://www.alfresco.org/model/content/1.0}content</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}folder-path</string>
            <string>/Company Home/RetailerSupplierInteraction/Proposal</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}created</string>
            <date>2010-08-26 12:49:54.431 MSD</date>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}store-identifier</string>
            <string>SpacesStore</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}resolved-path</string>
            <string>/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1.0}RetailerSupplierInteraction/{http://www.alfresco.org/model/content/1.0}Proposal/{http://www.alfresco.org/model/content/1.0}ID_2_Три_x0020_топора.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}node-dbid</string>
            <long>630</long>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}content-type</string>
            <string>text/xml</string>
          </entry>
        </attributeMap>
        <document serialization="custom">
          <com.adobe.idp.Document>
            <int>3</int>
            <boolean>false</boolean>
            <boolean>false</boolean>
            <null/>
            <string>81.5.113.36/127.0.0.1</string>
            <null/>
            <null/>
            <null/>
            <string>IOR:000000000000002849444C3A636F6D2F61646F62652F6964702F49446F63756D656E7443616C6C6261636B3A312E30000000000200000000000000EC000102000000000C38312E352E3131332E3336000DC8000000000015353834393831363137302F01163C37231524460635000000000000050000000000000008000000004A414300000000010000001C000000000501000100000001050100010001010900000001050100010000002100000060000000000000000100000000000000240000001E0000007E00000000000000010000000C38312E352E3131332E3336000DC9004000000000000000000000001004010008060667810201010100000000000000000000000000000000000000000000002000000004000000000000001F0000000400000003000000010000002000000000000000020000002000000004000000000000001F0000000400000003</string>
            <int>83</int>
            <string>text/xml</string>
            <null/>
            <map>
              <entry>
                <string>basename</string>
                <string>ID_2_Три топора.xml</string>
              </entry>
              <entry>
                <string>file</string>
                <string>ID_2_Три топора.xml</string>
              </entry>
              <entry>
                <string>wsfilename</string>
                <string>ID_2_Три топора.xml</string>
              </entry>
            </map>
            <string>adobe/idp/DocumentPullServant/adobejb_null</string>
            <long>-1</long>
          </com.adobe.idp.Document>
        </document>
      </com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
      <com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
        <attributeMap>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}creator</string>
            <string>usersystemcontext/DefaultDom</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}browse-link</string>
            <string>http://81.5.113.36:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/c793f4b8-0f42-462c-a75b-d104f286f66f/ID_3_Теремок.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}store-protocol</string>
            <string>workspace</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}content</string>
            <string>contentUrl=store://2010/11/17/18/56/b57edc81-c288-4258-9710-18632ad86a66.bin|mimetype=text/xml|size=3974|encoding=UTF-8|locale=en_</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}node-uuid</string>
            <string>c793f4b8-0f42-462c-a75b-d104f286f66f</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}modifier</string>
            <string>usersystemcontext/DefaultDom</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}name</string>
            <string>ID_3_Теремок.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}qualified-path</string>
            <string>/app:company_home/cm:RetailerSupplierInteraction/cm:Proposal/cm:ID_3_Теремок.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}modified</string>
            <date>2010-11-17 18:56:05.332 MSK</date>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}node-type</string>
            <string>{http://www.alfresco.org/model/content/1.0}content</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}folder-path</string>
            <string>/Company Home/RetailerSupplierInteraction/Proposal</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}created</string>
            <date>2010-08-26 12:51:10.671 MSD</date>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}store-identifier</string>
            <string>SpacesStore</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}resolved-path</string>
            <string>/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1.0}RetailerSupplierInteraction/{http://www.alfresco.org/model/content/1.0}Proposal/{http://www.alfresco.org/model/content/1.0}ID_3_Теремок.xml</string>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/system/1.0}node-dbid</string>
            <long>631</long>
          </entry>
          <entry>
            <string>{http://www.alfresco.org/model/content/1.0}content-type</string>
            <string>text/xml</string>
          </entry>
        </attributeMap>
        <document serialization="custom">
          <com.adobe.idp.Document>
            <int>3</int>
            <boolean>false</boolean>
            <boolean>false</boolean>
            <null/>
            <string>81.5.113.36/127.0.0.1</string>
            <null/>
            <null/>
            <null/>
            <string>IOR:000000000000002849444C3A636F6D2F61646F62652F6964702F49446F63756D656E7443616C6C6261636B3A312E30000000000200000000000000EC000102000000000C38312E352E3131332E3336000DC8000000000015353834393831363137302F01163C37231524460635000000000000050000000000000008000000004A414300000000010000001C000000000501000100000001050100010001010900000001050100010000002100000060000000000000000100000000000000240000001E0000007E00000000000000010000000C38312E352E3131332E3336000DC9004000000000000000000000001004010008060667810201010100000000000000000000000000000000000000000000002000000004000000000000001F0000000400000003000000010000002000000000000000020000002000000004000000000000001F0000000400000003</string>
            <int>84</int>
            <string>text/xml</string>
            <null/>
            <map>
              <entry>
                <string>basename</string>
                <string>ID_3_Теремок.xml</string>
              </entry>
              <entry>
                <string>file</string>
                <string>ID_3_Теремок.xml</string>
              </entry>
              <entry>
                <string>wsfilename</string>
                <string>ID_3_Теремок.xml</string>
              </entry>
            </map>
            <string>adobe/idp/DocumentPullServant/adobejb_null</string>
            <long>-1</long>
          </com.adobe.idp.Document>
        </document>
      </com.adobe.livecycle.contentservices.client.impl.CRCResultImpl>
    </list>
    I read Help about CRCResult variable, it is said there ,that we can receive the information like document, link , etc. from it. I can't figure out how to do it.So the question : what function should we apply or how can we get access to what we need? For example, i want to get document from the doclist.
    Thanks in advance.

  • Question regarding xsd and shredding

    All,
    I have the following xsd and xml file, I register the xsd in xmldb and create a resource from the xml file. Upon registration of the xsd, the proper (I think) tables are created and upon creating the resource the primary table seems to have a row in it. I am having a problem trying to figure out how to get the values out of the types that have the enumeration values. Any help would be appreciated.
    $sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.3.0 - Production on Tue Aug 28 10:40:41 2012
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, Real Application Clusters, OLAP and Data Mining options
    SQL> select * from V$VERSION
    2 /
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    TNS for HPUX: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL>
    xsd:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
         <xs:element name="ITEMS" xdb:defaultTable="TMP_ITEMS">
              <xs:complexType xdb:SQLType="TMP_ITEMS_T" xdb:maintainDOM="false">
                   <xs:sequence>
                        <xs:element name="ITEM_GROUP" xdb:SQLCollType="ITEM_GROUP_ROW_NTT">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="GROUP_A"/>
                                       <xs:enumeration value="GROUP_B"/>
                                       <xs:enumeration value="GROUP_C"/>
                                       <xs:enumeration value="GROUP_D"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                        <xs:element ref="ITEM" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="ITEM" xdb:defaultTable="TMP_ITEM" xdb:SQLType="TMP_ITEM_T" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="ITEM_NUMBER" type="xs:string"/>
                        <xs:element name="ITEM_STATUS">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="ACTIVE"/>
                                       <xs:enumeration value="INACTIVE"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                        <xs:element name="ITEM_DATE" type="xs:string"/>
                        <xs:element name="ITEM_ID" type="xs:string"/>
                        <xs:element ref="ITEM_SUBGROUP_1" maxOccurs="unbounded"/>               
                        <xs:element ref="ITEM_SUBGROUP_2" maxOccurs="unbounded"/>               
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="ITEM_SUBGROUP_1" xdb:defaultTable="TMP_ITEM_SUBGROUP_1" xdb:SQLType="TMP_ITEM_SUBGROUP_1_T" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="SUBGROUP_1_ID" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="ITEM_SUBGROUP_2" xdb:defaultTable="TMP_ITEM_SUBGROUP_2" xdb:SQLType="TMP_ITEM_SUBGROUP_2_T" xdb:maintainDOM="false">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="SUBGROUP_2_ID" type="xs:string"/>
                        <xs:element name="SUBGROUP_2_TYPE">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="SUBGROUP_TYPE_2_TYPE_A"/>
                                       <xs:enumeration value="SUBGROUP_TYPE_2_TYPE_B"/>
                                       <xs:enumeration value="SUBGROUP_TYPE_2_TYPE_C"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>xml:
    <?xml version="1.0"?>
    <ITEMS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="tmp_items.xsd">
         <ITEM_GROUP>GROUP_A</ITEM_GROUP>
         <ITEM>
              <ITEM_NUMBER>1</ITEM_NUMBER>
              <ITEM_STATUS>ACTIVE</ITEM_STATUS>
              <ITEM_ID>0000000123</ITEM_ID>
              <ITEM_SUBGROUP_1>
                   <SUBGROUP_1_ID>SG1_000000987</SUBGROUP_1_ID>
              </ITEM_SUBGROUP_1>
              <ITEM_SUBGROUP_2>
                   <SUBGROUP_2_ID>SG2_000000987</SUBGROUP_2_ID>
                   <SUBGROUP_2_TYPE>SUBGROUP_TYPE_2_TYPE_A</SUBGROUP_2_TYPE>
              </ITEM_SUBGROUP_2>
         </ITEM>
         <ITEM>
              <ITEM_NUMBER>2</ITEM_NUMBER>
              <ITEM_STATUS>INACTIVE</ITEM_STATUS>
              <ITEM_ID>0000000456</ITEM_ID>
              <ITEM_SUBGROUP_1>
                   <SUBGROUP_1_ID>SG1_000000654</SUBGROUP_1_ID>
              </ITEM_SUBGROUP_1>
              <ITEM_SUBGROUP_2>
                   <SUBGROUP_2_ID>SG2_000000654</SUBGROUP_2_ID>
                   <SUBGROUP_2_TYPE>SUBGROUP_TYPE_2_TYPE_A</SUBGROUP_2_TYPE>
              </ITEM_SUBGROUP_2>
         </ITEM>
    </ITEMS>registration of xsd:
    BEGIN
      IF DBMS_XDB.CREATERESOURCE(
         abspath => '/public/tmp/tmp_items.xsd',
         data    => BFILENAME ('XSD_DIR','tmp_items.xsd')
      THEN
         DBMS_XMLSCHEMA.REGISTERSCHEMA(
            schemaurl => 'tmp_items.xsd',
            schemadoc => sys.UriFactory.getUri('/public/tmp/tmp_items.xsd')
         COMMIT;
      END IF;
    END;creation on xml resource:
    declare
       v_return BOOLEAN;
    BEGIN
       v_return := DBMS_XDB.CREATERESOURCE(abspath => '/public/tmp/tmp_items.xml', data => BFILENAME('XML_DIR', 'tmp_items.xml'));
    END;query the high level:
      select xml.item_number                  as item_number,
             extractvalue(value(i),'/ITEMS/ITEM_GROUP') item_status
      from tmp_items i,
           table(i.xmldata.item) xmlquery the sub_group for one high level:
    select *
    from table(
    select xml.ITEM_SUBGROUP_2
      from tmp_items i,
           table(i.xmldata.item) xml
           where xml.item_number = '1')When I execute the above query, I can't seem to extract the value out of the subgroup_2_type element. I used the extractvalue function to get it out of the high level, but can't seem to get it right here.
    Thanks
    Eric
    Edited by: Eric Schrauth on Aug 28, 2012 8:39 AM

    Have to create a base view on the elements that will always be there and other views on the items that might not and query them appropriately. Right?Not necessarily.
    The usual approach is to use an OUTER JOIN :
    SELECT x1.item_number
         , x1.item_status
         , x2.*
    FROM tmp_items t
       , XMLTable(
           '/ITEMS/ITEM'
           passing t.object_value
           columns item_number     varchar2(15) path 'ITEM_NUMBER'
                 , item_status     varchar2(15) path 'ITEM_STATUS'
                 , item_subgroup_2 xmltype      path 'ITEM_SUBGROUP_2'
         ) x1
       , XMLTable(
           '/ITEM_SUBGROUP_2'
           passing x1.item_subgroup_2
           columns subgroup_2_id   varchar2(15) path 'SUBGROUP_2_ID'
                 , subgroup_2_type varchar2(15) path 'SUBGROUP_2_TYPE'
         ) (+) x2
    ;Or the equivalent with ANSI JOIN :
    SELECT x1.item_number
         , x1.item_status
         , x2.*
    FROM tmp_items t
       , XMLTable(
           '/ITEMS/ITEM'
           passing t.object_value
           columns item_number     varchar2(15) path 'ITEM_NUMBER'
                 , item_status     varchar2(15) path 'ITEM_STATUS'
                 , item_subgroup_2 xmltype      path 'ITEM_SUBGROUP_2'
         ) x1
       LEFT OUTER JOIN
         XMLTable(
           '/ITEM_SUBGROUP_2'
           passing x1.item_subgroup_2
           columns subgroup_2_id   varchar2(15) path 'SUBGROUP_2_ID'
                 , subgroup_2_type varchar2(15) path 'SUBGROUP_2_TYPE'
         ) x2
         ON 1 = 1
    ;

  • Problem with axis2 and Tomcat

    Hello,
    I am having a strange problem with Tomcat and axis. I have a webservice that uses axis2 for wsdl2java class generation. When I compile my project in maven a Test is performed. During the test a glassfish server is established and the project is deployed -everything work great with the expected results. However when I try to deploy the webservice on tomcat it has some problems.
    At first I tried to call axis code in a POST method that takes a MultiPart message. The code is as below:
    *@Path("identifyWavestream")*
    *@POST*
    *@Consumes(MediaType.MULTIPART_FORM_DATA)*
    *@Produces(MediaType.APPLICATION_XML)*
    *public String multipartTest(com.sun.jersey.multipart.MultiPart multiPart) throws Exception {* 
    *// get first body part (index 0)*
    *//tomcat shows that the first error is here (line 122 is the nest one with bodypart)*
    BodyPart bp = multiPart.getBodyParts().get(0);
    BodyPartEntity bodyPartEntity = (BodyPartEntity) bp.getEntity();
    InputStream stream = bodyPartEntity.getInputStream();
    *//the rest of the code either saves the incoming file or implements the wsdl2java axis interface - neither works.*
    And the tomcat error is:
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    java.util.ArrayList.RangeCheck(Unknown Source)
    java.util.ArrayList.get(Unknown Source)
    com.webserv.rest.resources.SearchResource.test.multipartTest(SearchResource.java:122)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:138)
    com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
    com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
    com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
    com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    It was strange to me since this simple approach of handling a Multipart method worked for me earlier. Then I decided skip the handling of multipart method and just call the axis code. But the results also caused an error. I then tried to call the axis code in a simple @GET method (to cross out any issues regarding the multipart) and the result where the same. Again everything works on the maven- glassfish test. In this case the tomcat error is the following:
    javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:361)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    root cause
    com.sun.jersey.api.container.MappableContainerException: java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
    com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:74)
    com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
    com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
    com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    root cause
    java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
    org.apache.axis2.transport.http.AbstractHTTPSender.initializeTimeouts(AbstractHTTPSender.java:454)
    org.apache.axis2.transport.http.AbstractHTTPSender.getHttpClient(AbstractHTTPSender.java:514)
    org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:156)
    org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
    org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
    org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
    org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
    org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
    org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
    org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
    com.webserv.rest.webapp.IntSoapServiceStub.getServerData(IntSoapServiceStub.java:2447)
    com.webserv..rest.resources.AIntSoapImpl.getServerData(AIntSoapImpl.java:112)
    com.webserv..rest.resources.SearchResource.test.pingTest(SearchResource.java:167)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:138)
    com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
    com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
    com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
    com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    I think it is also a good ide to post the pom.xml file :
    Edited by: 803864 on 2010-10-21 00:30

    I think it is also a good ide to post the pom.xml file:
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"+
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    +<modelVersion>4.0.0</modelVersion>+
    +<groupId>com.myProjects</groupId>+
    +<artifactId>audioid-rest-interface</artifactId>+
    +<packaging>war</packaging>+
    +<name>AudioID Rest Interface</name>+
    +<version>0.1</version>+
    +<dependencies>+
    +<!--+
    +<dependency>+
    +<groupId>com.sun.tools.xjc.maven2</groupId>+
    +<artifactId>maven-jaxb-plugin</artifactId>+
    +<version>1.1</version>+
    +<scope>test</scope>+
    +</dependency>+
    +<dependency>+
    +<groupId>com.sun.jersey</groupId>+
    +<artifactId>jersey-client</artifactId>+
    +<version>1.0.1</version>+
    +</dependency>+
    +<dependency>+
    +<groupId>com.sun.jersey.contribs</groupId>+
    +<artifactId>jersey-multipart</artifactId>+
    +<version>1.0.1</version>+
    +</dependency>+
    +<dependency>+
    +<groupId>com.sun.grizzly</groupId>+
    +<artifactId>grizzly-servlet-webserver</artifactId>+
    +<version>1.9.0</version>+
    +<scope>test</scope>+
    +</dependency>-->+
    +<dependency>+
    +<groupId>com.sun.jersey.contribs</groupId>+
    +<artifactId>jersey-multipart</artifactId>+
    +<version>1.0.1</version>+
    +</dependency>+
    +<dependency>+
    +<groupId>com.sun.jersey</groupId>+
    +<artifactId>jersey-client</artifactId>+
    +<version>1.0.1</version>+
    +</dependency>+
    +<dependency>+
    +<groupId>com.sun.jersey</groupId>+
    +<artifactId>jersey-bundle</artifactId>+
    +<version>1.0.1</version>+
    +</dependency>+
    +<dependency>+
    +<groupId>commons-logging</groupId>+
    +<artifactId>commons-logging</artifactId>+
    +<version>1.0.4</version>+
    +</dependency>+
    +<dependency>+
    +<groupId>commons-collections</groupId>+
    +<artifactId>commons-collections</artifactId>+
    +<version>3.1</version>+
    +</dependency>+
    +<dependency>+
    +<groupId>org.slf4j</groupId>+
    +<artifactId>slf4j-log4j12</artifactId>+
    +<version>1.5.6</version>+
    +</dependency>+
    +<dependency>+
    +<groupId>junit</groupId>+
    +<artifactId>junit</artifactId>+
    +<version>3.8.2</version>+
    +<scope>test</scope>+
    +</dependency>+
    +<dependency>+
    +<groupId>org.glassfish.distributions</groupId>+
    +<artifactId>web-all</artifactId>+
    +<version>10.0-build-20080430</version>+
    +<scope>test</scope>+
    +</dependency>+
    +<dependency>+
    +<groupId>org.glassfish.embedded</groupId>+
    +<artifactId>gf-embedded-api</artifactId>+
    +<version>1.0-alpha-4</version>+
    +<scope>test</scope>+
    +</dependency>+
    +<dependency>+
    +<groupId>com.sun.jersey</groupId>+
    +<artifactId>jersey-server</artifactId>+
    +<version>1.0.3.1</version>+
    +<scope>test</scope>+
    +</dependency>+
    +<dependency>+
    +<groupId>com.sun.jersey.contribs</groupId>+
    +<artifactId>maven-wadl-plugin</artifactId>+
    +<version>1.0.3.1</version>+
    +</dependency>+
    +<dependency>+
    +<groupId>org.hibernate</groupId>+
    +<artifactId>hibernate</artifactId>+
    +<version>3.2.5.ga</version>+
    +<exclusions>+
    +<exclusion>+
    +<groupId>javax.transaction</groupId>+
    +<artifactId>jta</artifactId>+
    +</exclusion>+
    +<exclusion>+
    +<groupId>cglib</groupId>+
    +<artifactId>cglib</artifactId>+
    +</exclusion>+
    +</exclusions>+
    +</dependency>+
    +<dependency>+
    +<groupId>org.apache.axis2</groupId>+
    +<artifactId>axis2</artifactId>+
    +<version>1.4.1</version>+
    +</dependency>+
    +<!-- <dependency> -->+
    +<dependency>+
    +<groupId>org.apache.axis2</groupId>+
    +<artifactId>axis2-aar-maven-plugin</artifactId>+
    +<version>1.4.1</version>+
    +<scope>test</scope>+
    +</dependency>+
    +<dependency>+
    +<groupId>org.apache.axis2</groupId>+
    +<artifactId>axis2-java2wsdl</artifactId>+
    +<version>1.4.1</version>+
    +<scope>test</scope>+
    +</dependency>+
    +<dependency>+
    +<groupId>org.apache.axis2</groupId>+
    +<artifactId>axis2-xmlbeans</artifactId>+
    +<version>1.4.1</version>+
    +</dependency>+
    +<!-- <dependency> -->+
    +<dependency>+
    +<groupId>com.sun.xml.bind</groupId>+
    +<artifactId>jaxb-impl</artifactId>+
    +<version>2.1.12</version>+
    +</dependency>+
    +<dependency>+
    +<groupId>cglib</groupId>+
    +<artifactId>cglib-nodep</artifactId>+
    +<version>2.1_3</version>+
    +</dependency>+
    +</dependencies>+
    +<build>+
    +<finalName>audioid-rest-interface</finalName>+
    +<plugins>+
    +<plugin>+
    +<!-- This class is just generated for wadl support!!! -->+
    +<!-- Take care that folder ../music-dna-core is existing -->+
    +<groupId>com.sun.tools.xjc.maven2</groupId>+
    +<artifactId>maven-jaxb-plugin</artifactId>+
    +<version>1.1</version>+
    +<executions>+
    +<execution>+
    +<phase>generate-sources</phase>+
    +<goals>+
    +<goal>generate</goal>+
    +</goals>+
    +</execution>+
    +</executions>+
    +<configuration>+
    +<generatePackage> com.webserv.wsparameters</generatePackage>+
    +<schemaDirectory>../audioid-rest-interface/src/main/resources+
    +</schemaDirectory>+
    +<includeSchemas>+
    +<includeSchema>**/*.xsd</includeSchema>+
    +</includeSchemas>+
    +<extension>true</extension>+
    +<strict>false</strict>+
    +<verbose>false</verbose>+
    +</configuration>+
    +</plugin>+
    +<plugin>+
    +<groupId>org.apache.maven.plugins</groupId>+
    +<artifactId>maven-javadoc-plugin</artifactId>+
    +<!-- <version>2.6</version> -->+
    +<executions>+
    +<execution>+
    +<goals>+
    +<goal>javadoc</goal>+
    +</goals>+
    +<phase>compile</phase>+
    +</execution>+
    +</executions>+
    +<configuration>+
    +<encoding>UTF-8</encoding>+
    +<verbose>false</verbose>+
    +<show>public</show>+
    +<subpackages> com.webserv.rest.rest.resources: com.webserv.rest.rest.commons: com.webserv.wsparameters+
    +</subpackages>+
    +<doclet>com.sun.jersey.wadl.resourcedoc.ResourceDoclet</doclet>+
    +<docletPath>${path.separator}${project.build.outputDirectory}+
    +</docletPath>+
    +<docletArtifacts>+
    +<docletArtifact>+
    +<groupId>com.sun.jersey.contribs</groupId>+
    +<artifactId>wadl-resourcedoc-doclet</artifactId>+
    +<version>1.0.3.1</version>+
    +</docletArtifact>+
    +<docletArtifact>+
    +<groupId>com.sun.jersey</groupId>+
    +<artifactId>jersey-server</artifactId>+
    +<version>1.0.3.1</version>+
    +</docletArtifact>+
    +<docletArtifact>+
    +<groupId>xerces</groupId>+
    +<artifactId>xercesImpl</artifactId>+
    +<version>2.6.1</version>+
    +</docletArtifact>+
    +</docletArtifacts>+
    +<additionalparam>-output+
    +${project.build.outputDirectory}/resourcedoc.xml</additionalparam>+
    +<useStandardDocletOptions>false</useStandardDocletOptions>+
    +</configuration>+
    +</plugin>+
    +<plugin>+
    +<groupId>com.sun.jersey.contribs</groupId>+
    +<artifactId>maven-wadl-plugin</artifactId>+
    +<version>1.0.3.1</version>+
    +<executions>+
    +<execution>+
    +<id>generate</id>+
    +<goals>+
    +<goal>generate</goal>+
    +</goals>+
    +<phase>compile</phase>+
    +</execution>+
    +</executions>+
    +<configuration>+
    +<wadlFile>${project.build.outputDirectory}/application.wadl+
    +</wadlFile>+
    +<formatWadlFile>true</formatWadlFile>+
    +<baseUri>http://192.168.2.149:8080/${project.build.finalName}+
    +</baseUri>+
    +<packagesResourceConfig>+
    +<param> com.webserv.rest.resources</param>+
    +</packagesResourceConfig>+
    +<wadlGenerators>+
    +<wadlGeneratorDescription>+
    +<className>com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc+
    +</className>+
    +<properties>+
    +<property>+
    +<name>applicationDocsFile</name>+
    +<value>${basedir}/src/main/doc/application-doc.xml</value>+
    +</property>+
    +</properties>+
    +</wadlGeneratorDescription>+
    +<wadlGeneratorDescription>+
    +<className>com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport+
    +</className>+
    +<properties>+
    +<property>+
    +<name>grammarsFile</name>+
    +<value>${basedir}/src/main/doc/application-grammars.xml</value>+
    +</property>+
    +</properties>+
    +</wadlGeneratorDescription>+
    +<wadlGeneratorDescription>+
    +<className>com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport+
    +</className>+
    +<properties>+
    +<property>+
    +<name>resourceDocFile</name>+
    +<value>${project.build.outputDirectory}/resourcedoc.xml</value>+
    +</property>+
    +</properties>+
    +</wadlGeneratorDescription>+
    +</wadlGenerators>+
    +</configuration>+
    +</plugin>+
    +<plugin>+
    +<groupId>org.codehaus.mojo</groupId>+
    +<artifactId>exec-maven-plugin</artifactId>+
    +<version>1.1</version>+
    +<executions>+
    +<execution>+
    +<goals>+
    +<goal>java</goal>+
    +</goals>+
    +</execution>+
    +</executions>+
    +<configuration>+
    +<mainClass>com.sun.jersey.samples.generatewadl.Main</mainClass>+
    +</configuration>+
    +</plugin>+
    +<plugin>+
    +<groupId>org.apache.maven.plugins</groupId>+
    +<artifactId>maven-compiler-plugin</artifactId>+
    +<inherited>true</inherited>+
    +<configuration>+
    +<source>1.5</source>+
    +<target>1.5</target>+
    +<!--+
    exclude temporary types that are only needed for wadl and doc
    generation
    -->
    +<!--+
    +<excludes> <exclude>com/webserv/types/temporary/**</exclude>+
    +<exclude>com/webserv/rest/commons/Examples.java</exclude>+
    +</excludes>+
    -->
    +</configuration>+
    +</plugin>+
    +<plugin>+
    +<groupId>org.jvnet.jaxb2.maven2</groupId>+
    +<artifactId>maven-jaxb2-plugin</artifactId>+
    +<executions>+
    +<execution>+
    +<goals>+
    +<goal>generate</goal>+
    +</goals>+
    +</execution>+
    +</executions>+
    +</plugin>+
    +<plugin>+
    +<groupId>org.apache.axis2</groupId>+
    +<artifactId>axis2-wsdl2code-maven-plugin</artifactId>+
    +<version>1.4.1</version>+
    +<executions>+
    +<execution>+
    +<id>generate reco core</id>+
    +<goals>+
    +<goal>wsdl2code</goal>+
    +</goals>+
    +<configuration>+
    +<packageName>com.webserv.rest.webapp</packageName>+
    +<wsdlFile>src/main/java/com/webserv/wsdl/web.wsdl</wsdlFile>+
    +<databindingName>adb</databindingName>+
    +</configuration>+
    +</execution>+
    +</executions>+
    +</plugin>+
    +<plugin>+
    +<groupId>com.sun.tools.xjc.maven2</groupId>+
    +<artifactId>maven-jaxb-plugin</artifactId>+
    +<version>1.1</version>+
    +<executions>+
    +<execution>+
    +<goals>+
    +<goal>generate</goal>+
    +</goals>+
    +</execution>+
    +</executions>+
    +<configuration>+
    +<generatePackage>com.webserv.wsparameters</generatePackage>+
    +<schemaDirectory>src/main/xsd</schemaDirectory> <includeSchemas>+
    +<includeSchema>**/*.xsd</includeSchema> </includeSchemas>+
    +<extension>true</extension>+
    +<strict>false</strict>+
    +<verbose>true</verbose>+
    +</configuration>+
    +</plugin>+
    +</plugins>+
    +</build>+
    +<profiles>+
    +<profile>+
    +<id>jdk-1.5</id>+
    +<activation>+
    +<jdk>1.5</jdk>+
    +</activation>+
    +<dependencies>+
    +<dependency>+
    +<groupId>com.sun.xml.bind</groupId>+
    +<artifactId>jaxb-impl</artifactId>+
    +<version>2.1.10</version>+
    +</dependency>+
    +</dependencies>+
    +<build>+
    +<plugins>+
    +<plugin>+
    +<groupId>org.apache.maven.plugins</groupId>+
    +<artifactId>maven-javadoc-plugin</artifactId>+
    +<configuration>+
    +<docletArtifacts>+
    +<docletArtifact>+
    +<groupId>com.sun.jersey.contribs</groupId>+
    +<artifactId>maven-wadl-plugin</artifactId>+
    +<version>1.0.3.1</version>+
    +</docletArtifact>+
    +<docletArtifact>+
    +<groupId>com.sun.jersey.contribs</groupId>+
    +<artifactId>wadl-resourcedoc-doclet</artifactId>+
    +<version>1.0.3.1</version>+
    +</docletArtifact>+
    +<docletArtifact>+
    +<groupId>com.sun.jersey</groupId>+
    +<artifactId>jersey-server</artifactId>+
    +<version>1.0.3.1</version>+
    +</docletArtifact>+
    +<docletArtifact>+
    +<groupId>xerces</groupId>+
    +<artifactId>xercesImpl</artifactId>+
    +<version>2.6.1</version>+
    +</docletArtifact>+
    +<docletArtifact>+
    +<groupId>javax.xml.bind</groupId>+
    +<artifactId>jaxb-api</artifactId>+
    +<version>2.1</version>+
    +</docletArtifact>+
    +<docletArtifact>+
    +<groupId>javax.xml</groupId>+
    +<artifactId>jaxb-impl</artifactId>+
    +<version>2.1</version>+
    +</docletArtifact>+
    +<docletArtifact>+
    +<groupId>javax.activation</groupId>+
    +<artifactId>activation</artifactId>+
    +<version>1.1</version>+
    +</docletArtifact>+
    +<docletArtifact>+
    +<groupId>javax.xml.stream</groupId>+
    +<artifactId>stax-api</artifactId>+
    +<version>1.0</version>+
    +</docletArtifact>+
    +</docletArtifacts>+
    +</configuration>+
    +</plugin>+
    +</plugins>+
    +</build>+
    +</profile>+
    +<profile>+
    +<id>xsltproc</id>+
    +<activation>+
    +<file>+
    +<exists>../xsltproc_win32/xsltproc.exe</exists>+
    +</file>+
    +</activation>+
    +<build>+
    +<plugins>+
    +<!-- Create/generate the application.html using xsltproc -->+
    +<!-- Create/generate the application.html using xsltproc -->+
    +<plugin>+
    +<groupId>org.codehaus.mojo</groupId>+
    +<artifactId>exec-maven-plugin</artifactId>+
    +<version>1.1</version>+
    +<executions>+
    +<execution>+
    +<id>copy-docs-to-builddir</id>+
    +<goals>+
    +<goal>exec</goal>+
    +</goals>+
    +<phase>compile</phase>+
    +<configuration>+
    +<executable>copy</executable>+
    +<commandlineArgs>src\\main\\doc\\*.* target\\classes+
    +</commandlineArgs>+
    +</configuration>+
    +</execution>+
    +<execution>+
    +<id>prepare-xsltproc</id>+
    +<goals>+
    +<goal>exec</goal>+
    +</goals>+
    +<phase>package</phase>+
    +<configuration>+
    +<executable>copy</executable>+
    +<commandlineArgs>..\\audioid-rest-interface\\src\\main\\resources\\*.xsd+
    target\\classes</commandlineArgs>
    +</configuration>+
    +</execution>+
    +<execution>+
    +<id>exec-xsltproc: target/application.html</id>+
    +<goals>+
    +<goal>exec</goal>+
    +</goals>+
    +<phase>package</phase>+
    +<configuration>+
    +<!--<executable>xsltproc</executable>-->+
    +<executable>../xsltproc_win32/xsltproc.exe</executable>+
    +<commandlineArgs>-o target/application.html+
    src/main/doc/wadl_documentation.xsl
    target/classes/application.wadl</commandlineArgs>
    +</configuration>+
    +</execution>+
    +</executions>+
    +</plugin>+
    +</plugins>+
    +</build>+
    +</profile>+
    +</profiles>+
    +<pluginRepositories>+
    +<pluginRepository>+
    +<id>maven2-repository.dev.java.net</id>+
    +<name>Java.net Repository for Maven</name>+
    +<url>http://download.java.net/maven/2/</url>+
    +<layout>default</layout>+
    +</pluginRepository>+
    +<pluginRepository>+
    +<id>maven-repository.dev.java.net</id>+
    +<name>Java.net Maven 1 Repository (legacy)</name>+
    +<url>http://download.java.net/maven/1</url>+
    +<layout>legacy</layout>+
    +</pluginRepository>+
    +</pluginRepositories>+
    +<repositories>+
    +<repository>+
    +<id>maven2-repository.dev.java.net</id>+
    +<name>Java.net Repository for Maven</name>+
    +<url>http://download.java.net/maven/2/</url>+
    +<layout>default</layout>+
    +</repository>+
    +<repository>+
    +<id>maven-repository.dev.java.net</id>+
    +<name>Java.net Maven 1 Repository (legacy)</name>+
    +<url>http://download.java.net/maven/1</url>+
    +<layout>legacy</layout>+
    +</repository>+
    +<repository>+
    +<id>glassfish-repository</id>+
    +<name>Java.net Repository for Glassfish</name>+
    +<url>http://download.java.net/maven/glassfish</url>+
    +</repository>+
    +</repositories>+
    +</project>+
    Can anyonr contribute?

  • Can someone pleas tell me about abap, java and xslt mappings

    Hi,
    can someone please tell me about abap, java and xslt mappings.
    Thanks,
    Bernard.

    HI,
    JAVA mapping
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping /people/amol.joshi2/blog/2006/03/10/think-objects-when-creating-java-mappings /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping sample code for java mapping blog=/pub/wlg/4143 tutorial sax and dom
    ABAP mapping
    ABAP mappings run on ABAP Stack and are developed in the ABAP workbench of the Integration Server.
    You normally do not need to use the ABAP mappings and is preferable for someone with ABAP programming background. I should say JAVA functions would suffice any complex scenarios.
    refer step by step guides for ABAP Mapping
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
    ABAP Mapping
    /people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs
    https://websmp101.sap-ag.de/~sapdownload/011000358700003082332004E/HowToABAPMapping.pdf
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    /people/r.eijpe/blog
    ABAP Mapping Vs Java Mapping.
    Re: Message Mapping of type ABAP Class not being shown
    Re: Performance of mappings (JAVA, XSLT, ABAP)
    XSLT Mapping
    XSLT stands for EXtensible Stylesheet Language Transformations. It is an XML based language for transforming XML documents into any other formats suitable for browser to display, on the basis of set of well-defined rules.
    /people/sap.user72/blog/2005/03/15/using-xslt-mapping-in-a-ccbpm-scenario
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/006aa890-0201-0010-1eb1-afc5cbae3f15
    /people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=xslt+mapping&adv=false&sortby=cm_rnd_rankvalue#
    Steps required for developing XSLT Mapping
    u2022 Create a source data type and a target data type
    u2022 Create Message types for the source and target data types.
    u2022 Create Message Interfaces includes Inbound Message interface and Outbound Message interface.
    u2022 XSLT Mapping does not require creation of Message mapping, so donu2019t create any Message mapping.
    u2022 Create an .XSL file which converts source data type into target data type.
    u2022 Zip that .xsl file and import it into Integration Repository under Imported Archives.
    u2022 In Interface Mapping choose mapping program as XSL and specify this zip program. (Through search help you will get XSL Mapping programs that you imported under Imported Archives, select your corresponding XSL Program)
    u2022 Test this mapping program by navigating to Test tab.
    By having look at above steps you can easily find out that this mapping is no where different from other mapping programs, here the challenging lies in creating an XSLT file. If you spend couple of minutes in studying XPATH tutorial you would be in ideal position to create an XSL Transformation (.xsl extension).
    If you still find difficulties in generating XSL Transformation, then you can make use of a tool u201CAltova MapForceu201D which will create XSL file for you.
    Steps for creating XSL file using this tool:
    1. Open the Alto MapForce, import the source .xml and .xsd file in it
    2. Similarly import the target .xml and .xsd in MapForce.
    3. These two data files should match with source and target data types in Integration Repository.
    4. Complete the graphical mapping using extensive list of XSLT functions available there.
    5. Save the mapping file.
    6. Click the XSLT tab. You will have the entire xslt logic there.
    7. Copy that content and save it as .xsl file.
    8. Zip above .xsl file and import the same into IR under Imported Archives.
    Hope this clears your doubts
    Thanks
    Saiyog

  • XML file validation with XSD and loading to database relational table

    Hi all,
    I have some xml files coming to my unix directory. I will be having an XSD for those. My task is to validate those xml against given xsd and load the corresponding data into oracle relational tables with sqlloader only.
    Please help me to accomplish. and let me know the contents of control file ( for SQLLOADER) if i want to load the xml directly to database.
    Unix and/or PLSQL suggestions both are welcome.

    My problem area is loading the XML to Oracle relational tables using sqlloader.
    suppose, the xml is <?xml version="1.0"?>
    <Customers>
    <Customer>
    <CustID>1</CustID>
    <Company>Bell South</Company>
    <City>New York</City>
    </Customer>
    <Customer>
    <CustID>2</CustID>
    <Company>Barnes &amp; Noble</Company>
    <City>New York</City>
    </Customer>
    <Customer>
    <CustID>3</CustID>
    <Company>Comp USA</Company>
    <City>Tampa</City>
    </Customer>
    <Customer>
    <CustID>4</CustID>
    <Company>Borders</Company>
    <City>Charlotte</City>
    </Customer>
    </Customers>
    and I have a relational table
    CREATE TABLE CUSTOMERS
    CUSTID NUMBER,
    COMPANY VARCHAR2(100 BYTE),
    CITY VARCHAR2(100 BYTE)
    how to insert the xml data into the table???
    please help..
    Edited by: nuon on Oct 25, 2010 6:25 AM

  • XML Comparison without DTD & XSD and able to return XPath of the Diff Node

    Dear All,
    I am new xml concept in java.
    First xml can have n of nodes and second xml can have n of the node.
    The node is new to second xml when compare to first xml.It has to go change list.
    1. My job is to compare 2 xml document and return the XPath of the Nodes.
    2. Both xml do not have any association like XSD,DTD and XSLT.
    3. I am looking for java api to find/return xpath of the node.
    Please help me.
    Saravanan.P

    Don't know if there's a method for this in the default XML parsing interface of Java (JAXP). I never came across a method which would return an XPath expression based on a Node and a Document. Only the other way around: return the Node(s) based on a Document and an XPath expression. Maybe some Java XML framework like XStream or an Apache XML framework have this functionality. It would be possible (not really nice though) to create such a method yourself. Based on a Document and a Node as input you could iterate through the parent elements until you reach the root Node and return the path. You would need to take into account that a Node can be part of a NodeList, so you have to retrieve the index of the Node in the list too.
    Ronald

  • Performance issue: Java and XSLT

    I have a performance issue concerning Java and XSLT: my goal is to transform an xml file (source.xml)
    by using a given xsl file (transformation.xsl). As result I would like to get a String object, in which the result
    of the transformation (html-code) is in, so that I can display it in a browser. The problem is the long time
    it takes for the code below to run through.
    xml = new File("C:\\source.xml");
    xmlSource = new StreamSource(xml);
    xslt = new File("C:\\transformation.xsl");
    StreamSource xsltSource = new StreamSource(xslt);
    TransformerFactory transFact = TransformerFactory.newInstance();
    trans = transFact.newTransformer(xsltSource);
    StringWriter stringWriter = new StringWriter();
    StreamResult streamResult = new StreamResult(stringWriter);
    trans.transform(xmlSource, streamResult);
    String output = stringWriter.toString();
    stringWriter.close();
    Before, I made the same transformation in an xml development environment, named Cooktop
    (see http://xmlcooktop.com/). The transformation took about 2 seconds. With the code above in Java it
    takes about 20 seconds.
    Is there a way to make the transformation in Java faster?
    Thanks in advance,
    Marcello
    Oldenburg, Germany
    [email protected]

    I haven't tried it but the if you can use java 6, you could try the new stax (StAX) with the XML stream loading..
    Take a look at:
    http://javaboutique.internet.com/tutorials/staxxsl/
    Then, you could cache the xslt in templates:
    ---8<---
    templates = transformerFactory.newTemplates( xsltSource );
    Transformer transformer = templates.newTransformer();
    (here you could probobly also cache the Transformer object but I think it's it's not thread safe so it's a little tricker..)
    StreamResult result = new StreamResult( System.out );
              transformer.transform(xmlSource, result);
    And, don't transform your result to a string, use a Stream or something, then the transformer could start pumping out html while working, and if you get a out of memory error it looks like you have a pretty big xml file...
    If you use jsp you could try the build in jsp taglib for xml which I think is rather good and they have support for varReader which implements the StreamSource iirc.
    /perty

  • Problem with JPanel and/or Thread

    Hello all,
    I have the following problem.
    I have a JFrame containing to JPanels. The JPanels are placed
    via BorderLayout.
    JPanel #1 is for moving a little rectangle (setDoubleBufferd), it is
    a self defined object extending JPanel.
    The paint methon in JPanel #1 has been overwritten to do the drawings.
    JPanel #2 contains 4 JButtons, but they have no effect at the
    moment. It is an "original" JPanel.
    The class extending JFrame implemented the interface Runnable and
    is started in its own thread.
    After starting the programm everthing looks fine.
    But if I press a Button in the second JPanel this button is painted in
    the top left corner of my frame. It changes if I press another button.
    Any help would be appreciated.
    Thanks.
    Ralf

    I have a JFrame containing to JPanels. The JPanels are
    placed
    via BorderLayout.The type of Layout does not seem to be relevant
    >
    JPanel #1 is for moving a little rectangle
    (setDoubleBufferd), it is
    a self defined object extending JPanel.
    The paint methon in JPanel #1 has been overwritten to
    do the drawings.
    JPanel #2 contains 4 JButtons, but they have no effect
    at the
    moment. It is an "original" JPanel.
    The class extending JFrame implemented the interface
    Runnable and
    is started in its own thread.
    After starting the programm everthing looks fine.
    But if I press a Button in the second JPanel this
    button is painted in
    the top left corner of my frame. It changes if I press
    another button.
    I noticed you solved this by painting the whole JFrame.
    Yeh Form time to time I get this problem too......
    Especially if the screen has gone blank - by going and having a cup of tea etc -
    Text from one Panel would be drawn in another.. annoying
    At first it was because I changed the state of some Swing Components
    not from the Event Thread.
    So make sure that your new Thread doesn't just blithely call repaint() or such like cos that leads to problems
    but rather something like
    SwingUtilities.invokeLater( new Runnable()
       public void run()
          MyComponent.repaint();
    });However I still get this problem using JScrollPanes, and was able to fix it by using the slower backing store method for the JScrollPane
    I could not see from my code how something on one JPanel can get drawn on another JPanel but it was happening.
    Anyone who could totally enlighten me on this?

  • Problem with JFrame and busy/wait Cursor

    Hi -- I'm trying to set a JFrame's cursor to be the busy cursor,
    for the duration of some operation (usually just a few seconds).
    I can get it to work in some situations, but not others.
    Timing does seem to be an issue.
    There are thousands of posts on the BugParade, but
    in general Sun indicates this is not a bug. I just need
    a work-around.
    I've written a test program below to demonstrate the problem.
    I have the problem on Solaris, running with both J2SE 1.3 and 1.4.
    I have not tested on Windows yet.
    When you run the following code, three JFrames will be opened,
    each with the same 5 buttons. The first "F1" listens to its own
    buttons, and works fine. The other two (F2 and F3) listen
    to each other's buttons.
    The "BUSY" button simply sets the cursor on its listener
    to the busy cursor. The "DONE" button sets it to the
    default cursor. These work fine.
    The "SLEEP" button sets the cursor, sleeps for 3 seconds,
    and sets it back. This does not work.
    The "INVOKE LATER" button does the same thing,
    except is uses invokeLater to sleep and set the
    cursor back. This also does not work.
    The "DELAY" button sleeps for 3 seconds (giving you
    time to move the mouse into the other (listerner's)
    window, and then it behaves just like the "SLEEP"
    button. This works.
    Any ideas would be appreciated, thanks.
    -J
    import java.awt.BorderLayout;
    import java.awt.Cursor;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    public class BusyFrameTest implements ActionListener
    private static Cursor busy = Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR);
    private static Cursor done = Cursor.getDefaultCursor();
    JFrame frame;
    JButton[] buttons;
    public BusyFrameTest (String title)
    frame = new JFrame (title);
    buttons = new JButton[5];
    buttons[0] = new JButton ("BUSY");
    buttons[1] = new JButton ("DONE");
    buttons[2] = new JButton ("SLEEP");
    buttons[3] = new JButton ("INVOKE LATER");
    buttons[4] = new JButton ("DELAY");
    JPanel buttonPanel = new JPanel();
    for (int i = 0; i < buttons.length; i++)
    buttonPanel.add (buttons);
    frame.getContentPane().add (buttonPanel);
    frame.pack();
    frame.setVisible (true);
    public void addListeners (ActionListener listener)
    for (int i = 0; i < buttons.length; i++)
    buttons[i].addActionListener (listener);
    public void actionPerformed (ActionEvent e)
    System.out.print (frame.getTitle() + ": " + e.getActionCommand());
    if (e.getActionCommand().equals ("BUSY"))
    frame.setCursor (busy);
    else if (e.getActionCommand().equals ("DONE"))
    frame.setCursor (done);
    else if (e.getActionCommand().equals ("SLEEP"))
    frame.setCursor (busy);
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.print (" finished");
    else if (e.getActionCommand().equals ("INVOKE LATER"))
    frame.setCursor (busy);
    SwingUtilities.invokeLater (thread);
    else if (e.getActionCommand().equals ("DELAY"))
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (busy);
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.print (" finished");
    System.out.println();
    Runnable thread = new Runnable()
    public void run()
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.println (" finished");
    public static void main (String[] args)
    BusyFrameTest f1 = new BusyFrameTest ("F1");
    f1.addListeners (f1);
    BusyFrameTest f2 = new BusyFrameTest ("F2");
    BusyFrameTest f3 = new BusyFrameTest ("F3");
    f2.addListeners (f3); // 2 listens to 3
    f3.addListeners (f2); // 3 listens to 2

    I've had the same problems with cursors and repaints in a swing application, and I was thinking of if I could use invokeLater, but I never got that far with it.
    I still believe you would need a thread for the time consuming task, and that invokeLater is something you only need to use in a thread different from the event thread.

  • Problem with installing and running some applications or drivers

    When installing and installing some items, towards the end of the installation I get this message:
    /System/Library/Extensions/comcy_driver_USBDevice.kext
    *was installed improperly and cannot be used. Please try reinstalling it or contact product's vendor for update*
    The end result is that some things do not seem to work properly, such as my HP printer. Would anybody have any ideas on how to fix this problem?

    Thank you for your response. Originally, I had a problem with Airport and ended up reinstalling Snow Leopard. Since then, when downloading upgrades etc, such as HP printer drivers, iTunes etc., towards the end of the download when its running the script, I get this message: /System/Library/Extensions/comcy_driver_USBDevice.kext
    +was installed improperly and cannot be used. Please try reinstalling it or contact product's vendor for update+
    Sometimes, the download hangs and is unable to complete. The main problem I've encountered so far with an application is when I use the printer to scan an image via Preview, it's blank: there's nothing there.

  • Problem with JNI and Tomcat (and threads???)

    Howdy,
    Here is the issue - I would like some help on HOW to debug and fix this problem:
    2 test use cases -
    1)
    a)User goes to Login.jsp, enters user and password
    b) User submits to LoginServlet
    c) login calls JNI code that connects to a powerbuilder(Yes I know this is ugly) PBNI code module (this is a .dll) that authenticates the user with the database
    d) the servlet then redirects to another .jsp page
    e) user then submits to LogoutServlet - also a JNI call to a powerbuilder PBNI code module
    f) REPEAT STEPS a-e over a few times (inconsistent) and then the call to the JNI code hangs
    2)
    a) users does NOT goto Login.jsp, but rather calls LoginServlet and passes the userid and password as GET parms
    b) user does NOT get redirected to a page (redirect code commented out)
    c) user calls LogoutServlet
    d) repeat steps a-c at will and no failure, no hanging
    The only difference is that in case 1 (with JSP), there is a redirect and it afffected the JNI call by haniging inside JNI code.
    In case 2 (without JSP) there is still a JNI call, but it does not hang. In addition, when it hangs and I stop Tomcat, the logs show cleanup entries that say:
    Oct 19, 2004 9:17:09 AM org.apache.catalina.core.StandardWrapper unload
    INFO: Waiting for 1 instance(s) to be deallocated
    Oct 19, 2004 9:17:10 AM org.apache.catalina.core.StandardWrapper unload
    INFO: Waiting for 1 instance(s) to be deallocated
    Oct 19, 2004 9:17:11 AM org.apache.catalina.core.StandardWrapper unload
    INFO: Waiting for 1 instance(s) to be deallocated
    Is this a threading issue in Tomcat???
    On would assume that the JNI code is not cleaning up after itself, but I don't believe this is the case,
    and even if it was, why would I get the tomcat log cleanup entries above???
    What do those cleanup entries imply about the state of Tomcat????

    hi ,
    I met the same problem this morning, and searched the www.google.com in order to solve it, as a result, your article was shown on my screen. :)
    Till now I have read some technical information and solved my problems. Maybe the solution be useful to you:
    ==============================
    error message : (Environment : Tomcat 5, Windows 2003, Mysql5)
    2006-3-29 11:53:48 org.apache.catalina.core.StandardWrapper unload
    message: Waiting for 2 instance(s) to be deallocated
    ==============================
    cause: the number of connection to database exceeded.another word,too many connections.
    ==============================
    solution: close the connection when it becomes useless for your program. :)
    ==============================
    ps. Sorry for my weak English . hehe ....

Maybe you are looking for