Pers. Migr. XML 6
Hello,
I want to use the Person. Migration but I'm running in to an error:This
application has requested the runtime to terminate it in an unusual way.
I'm running MS XML core Services 6 on the desktops.
Could this be the problem?
thanks in Advance,
Peter
Peter,
It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.
Has your problem been resolved? If not, you might try one of the following options:
- Visit http://support.novell.com and search the knowledgebase and/or check all
the other self support options and support programs available.
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://support.novell.com/forums)
Be sure to read the forum FAQ about what to expect in the way of responses:
http://support.novell.com/forums/faq_general.html
If this is a reply to a duplicate posting, please ignore and accept our apologies
and rest assured we will issue a stern reprimand to our posting bot.
Good luck!
Your Novell Product Support Forums Team
http://support.novell.com/forums/
Similar Messages
-
On first launch, my app copies about 100 tiny XML files from application dir to storage dir. It takes about 35 seconds. That is clearly an issue. It takes about 1/100th of a second on any other platform. I've switched to copyToAsync() so that the user doesn't bail, but still this is like using a dial-up modem! Anyone have any thoughts?
Hi all,
I ran into the same problem on Android: File.copyToAsynch is terribly slow. For 200 files of about 42mb total, it took my Samsung Note 10.1 85 secs to copy from app dir to storage dir! (I have to copy the files to storage dir to be able to read modification date, which is not present in app dir, for an update scheme.)
The solution I ended up with is very simple:
Iterate recursively over folder that you want to copy.
For each file that is not a directory, open the file (using FileStream) , read the bytes, write the bytes to a file on the target directory and close the streams.
This took only 5 secs for the same 200 files / 42 mbs. As this happens only on first run of my app, this is very acceptable.
Here is my code :
var folder:String = "content/";//supply your folder here
var src:File = File.applicationDirectory.resolvePath(folder);
var goal:File = File.applicationStorageDirectory;
var bytes:ByteArray = new ByteArray();
var stream:FileStream = new FileStream();
var iterate:Function = function(dir:File, path:String):void
var files:Array = dir.getDirectoryListing();
for each(var file:File in files)
if (file.isDirectory)
iterate(file, path + file.name + File.separator);
else
bytes.clear();
stream.open(file, FileMode.READ);
stream.readBytes(bytes);
stream.close();
var dest:File = goal.resolvePath(path+file.name);
stream.open(dest, FileMode.WRITE);
stream.writeBytes(bytes);
stream.close();
iterate(src, folder);
This could easily be reworked to work asynch of course.
Hope this works for other people as well.
Reinier -
Genearte XML as per its XML schema
How would I generate an XML document from XML-DB which conform to a registered
Schema? My tables and xsd are as follows:
Customer table
==============
create table cust
( id number primary key,
last_name varchar2(50),
first_name varchar2(50),
fullname varchar2(50),
dob date
Cust_address table
==================
create table cust_address
(addr_id number primary key,
address_1 varchar2(100),
address_2 varchar2(100),
county varchar2(4),
home_ph varchar2(20),
office_ph varchar2(20),
cust_id number references cust(id) );
Some data
SQL> insert into cust
2 values( 1, 'Harvey','John','Jeff M Harvey','18-jun-80');
1 row created.
insert into cust_address
values ( 1,' 21 West Trophy Road','Memphis,
TN','0009','901-6782345','901-768234',1);
My XMLSchema is as follows:
===========================
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U (
http://www.altova.com
by John -->
<xs:schema
xmlns="
http://www.oaws.org/CAR"
xmlns:xs="
http://www.w3.org/2001/XMLSchema"
targetNamespace="
http://www.oaws.org/CAR"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="CARData">
<xs:annotation>
<xs:documentation>Customer Contact information etc
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="NameType"/>
<xs:element name="Address" type="AddressType"/>
<xs:element name="PlayerContact">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="NameType"/>
<xs:element name="Address" type="AddressType"/>
<xs:element name="PlayCntySher" type="xs:string"/>
<xs:element name="PlayCntyClk" type="xs:string"/>
<xs:element name="PlayAlsTyp" type="xs:string"/>
<xs:element name="Play" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="BankContact">
<xs:complexType>
<xs:sequence>
<xs:element name="BKName" type="xs:string"/>
<xs:element name="BKAddr1" type="xs:string"/>
<xs:element name="BKAddr2" type="xs:string"/>
<xs:element name="BKAddrfnl" type="xs:string"/>
<xs:element name="BKCNTY" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="LTRDT" type="xs:date"/>
</xs:complexType>
</xs:element>
<xs:complexType name="AddressType">
<xs:sequence>
<xs:element name="playaddr1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="playaddr2">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="playaddrfnl" type="xs:string"/>
<xs:element name="playhomecomm">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="playwrkcomm">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="playcnty">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="25"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NameType">
<xs:sequence>
<xs:element name="PlayFullName" type="xs:string"/>
<xs:element name="PlayFName" type="xs:string"/>
<xs:element name="PlayLName" type="xs:string"/>
<xs:element name="PlayDefName" type="xs:string"/>
<xs:element name="PlayIDNum">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="12"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="PlayDob" type="xs:date"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="money">
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CollectorType">
<xs:sequence>
<xs:element name="CollectorNumber" type="xs:integer"/>
<xs:element name="CarFullName" type="xs:string"/>
<xs:element name="CollectorPhone" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
I have registered this schema in to my database schema
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 '
http://tien.oaws.silver:8080/home/CAR/xsd/',
5 xdbURIType('/home/CAR/xsd/CARSchema.xsd').getClob(),
6 True,True,False,True
7 );
8 End;
9 /
PL/SQL procedure successfully completed.
Now I need to generate an XML which include all elements from CUST and
CUST_ADDRESS table and must conform to the XML Schema, need your help.
Thank you.This is not the proper forum for these questions. Please visit the XML DB forum for help with using XML DB features. XML DB
-
I need to know how to import xml files into indesign cs6.
My client wants to send me xml text files to import into Indesign for a multi-page publication. I don't have a clue where to start. Can you point me to a tutorial that would help me figure this out?
I have a sample file that looks like this:
<?xml version="1.0"?>
<providers>
<provider>
<name>Bow Valley College</name>
<description>Putting the Community back in college…in the Bow Corrid
ANY TIME, ANY PLACE, ANY PATH, ANY PACE LEARNING.
Designated as the comprehensive community college for Calgary & its
surrounding region, Bow Valley College offers you learning opportunities
through flexible delivery options, including classrooms, online or self
paced modules. Whether you are taking a course for interest, to enhance
your career skills or to finish high school you have access to all of the
traditional Bow Valley College student supports.
Visit our website [2] or come see us at our Canmore campus.
BOW VALLEY LEARNING COUNCIL MEMBER.
Links:
[1] http://www.bowvalleycollege.ca/bow-corridor.html
</description>
<contact_information>Canmore Campus
Provincial Building, 800 Railway Ave.
Canmore, AB  T1W 1P1
OFFICE HOURS: 8:30am - 4:30pm, Monday - Friday (except from 12 - 1pm)
PHONE: (403) 678-3125
FAX: (403) 678-3127
BANFF CAMPUS: Lower Level, Banff YWCA, 102 Spray Ave., Banff (ONLY OPEN
WHEN COURSES OFFERED). </contact_information>
<email>[email protected]</email>
<website>www.bowvalleycollege.ca/bow-corridor</website>
<registration_information>Cancellation policy: Once your course has begun no refunds or credits will
be given. Compassionate grounds may be considered with official
documentation. There are no refunds, transfers, or credits if you cancel
within one week of the course start date.
BY PHONE: (403) 678-3125. Payment by Visa or Mastercard
IN PERSON: Canmore Campus, Provincial Building, 800 Railway Ave., Canmore.
Payment by cash, Visa or Mastercard.
 
FUNDING ASSISTANCE MAY BE AVAILABLE FOR THOSE ON A LOW INCOME ON SOME
COURSES. PLEASE ASK FOR MORE INFORMATION.</registration_information>
<courses>
<course>
<title>Computer Basics/Windows 7 - Instructor led, Canmore</title>
<description>An instructor will lead the class through the basic features of Microsoft
Windows, the Internet and Email. Find out how to start programs, create,
save and organize your files and use the online help feature. You’ll also
get an introduction to surfing the internet and setting up an email
account. This course is designed for those with little or no computer
experience – and is still our most popular course. 18 HR COURSE.</description>
<schedule_entries>
<entry>
<date>Mon 6:30 - 9 pm, Oct 7 - Dec 2</date>
<date>Thu 6:30 - 9 pm, Oct 10 - Dec 5</date>
</entry>
</schedule_entries>
</course>
<course>
<title>Word 2010 Introduction - Self-paced</title>
<description>Explore the basics of Microsoft Word to produce professional letters and
documents. This course guides you through the effective use of the Word
Ribbon and Quick Access Toolbar. You’ll learn how to efficiently edit,
move and copy text; manipulate fonts; apply bullets and numbering; borders
and shading; insert and re-size Clip Art; enter headers and footers; insert
page numbers; set alignment and indents; and change page settings. You’ll
learn to use the AutoCorrect feature and finish documents using the
spelling, thesaurus and grammar features.
Self-paced, 18 hr course.
Prerequisite recommended: Computer Basics or equivalent experience.</description>
<schedule_entries>
<entry>
<date>Mon 7:30 - 9 pm, Oct 7</date>
<date>Thu 7:30 - 9 pm, Dec 5</date>
</entry>
</schedule_entries>
</course>
<course>
AND SO ON...FOR 64 PAGES WORTH OF CONTENT
HELP!!!
SGARENHello Sally,
First, I have only heard/read good things about the book Steve recommends. It is on my to buy list one day. Been awaiting a long deserved vaction to pick it up to read.
I approach XML files pretty much like I do any text file I am sent in that I will import or copy/paste a text file into a frame in ID and begin setting my styles. With XML, though, I first clean it up, move closing tags up to their logical close lines, remove spurious codes that mean something in HTML but don't necessarily belong in the XML file (like ’ which is an apostrophe so I do a search and replace. But for   which is a non-breaking space I simply search and replace with a regular space in general), and make sure the XML validates.
Validation is much like making sure an HTML page is formed properly. I use an XML editor (XML BluePrint) and a text editor (UltraEdit) for these tasks. If I had to only have one or the other, I suppose the XML editor is what I would use.
I always show the import options when I import the XML and make sure that I link to the file.
So once a sample of the XML is on a page in ID (via File | Import XML), I highlight text within a tag, say like in your example above, the Providor name, and make it like I want and then create a new style. I generally name the styles as per the XML tag. Later on, that makes mapping tags to styles a little easier.
Once I set up all the styles preliminarily, I map the tags to styles. You can do that either via the Tags palette or via the Structure Pane that will appear once the XML is imported. In both cases, it is found via the flyout menu at the top right of their respective windows.
After mapping my styles to the tags, I select the root element in the Structure Pane (the topmost element. In your sample above it is "providors" and delete it. This removes the XML in your ID file. But the styles and tags are still present.
Then I import the XML again and look to makes sure all the tags/elements are styled as intended. I then correct any errors/ommissions. Then...I'll delete the XML again and import the full XML file.
I can upload what I did with your XML sample above so you can compare it to your source file if you would like. You would then see how/where I moved tags. Now, moving the tags is only "necessary" to avoid all the extra blank paragraphs. That can be accomplished by ID's search/replace, too. But I like to start out with the XML cleaned up, so I take the few minutes to do it.
Take care, Mike -
How to create a dyanamic query in PL/SQL from XML
Hi Forum,
I am having an XML file with tags. I am controlling my JSP page layout with these tags and it is working fine. But I need to send the Orange colour nodes to a pl/sql in the JSP page to construct the query as per the XML
<?xml version="1.0"?>
<Jobmanage>
<Customer name="StGeorge">
<Column>
<Name>QM_NUMBER</Name>
<Title>Job Number</Title>
<Width>10</Width>
<Font>Arial</Font>
<Size>10</Size>
<Align>center</Align>
<Display>Yes</Display>
<cloumn1> QM_NUMBER <column1>
</Column>
<Column>
<Name>QM_JOB_STATUS</Name>
<Title>Job Status</Title>
<Width>10</Width>
<Font>Arial</Font>
<Size>105</Size>
<Align>center</Align>
<Display>Yes</Display>
<column2>QM_JOB_STATUS</column2>
</Column>
<Column>
<Name>QM_USER_STATUS</Name>
<Title>User Status</Title>
<Width>10</Width>
<Font>Arial</Font>
<Size>10</Size>
<Align>center</Align>
<Display>Yes</Display>
<column3>QM_USER_STATUS</column3>
</Column>
</Customer>
</Jobmanage>
The select statement I am using n the JSP page is
SELECT Q.QM_NUMBER, Q.QM_JOB_STATUS, Q.QM_USER_STATUS FROM QMI Q WHERE ((Q.QM_JOB_STATUS IN (5, 6, 7, 8, 9, 10)) OR (Q.QM_JOB_STATUS IN (12) AND Q.QM_CLOSE_DATE >= SYSDATE - INTERVAL '6' MONTH))
Can you give me instructions how to create the above SQL statement dynamically as per the XML file. I want the select statement in a pl/sql
BEGIN
SELECT Q.QM_NUMBER, Q.QM_JOB_STATUS, Q.QM_USER_STATUS FROM QMI Q WHERE ((Q.QM_JOB_STATUS IN (5, 6, 7, 8, 9, 10)) OR (Q.QM_JOB_STATUS IN (12) AND Q.QM_CLOSE_DATE >= SYSDATE - INTERVAL '6' MONTH))
END
So, when ever the columns hirerachy changed in the XML file it should show theat effect in the PL/SQl. Thats hoe I am aiming to develop.
Thankx for you time.
Cheers,
KrishnaI want the select statement in a pl/sql BEGIN
SELECT Q.QM_NUMBER, Q.QM_JOB_STATUS, Q.QM_USER_STATUS FROM QMI Q WHERE ((Q.QM_JOB_STATUS
IN (5, 6, 7, 8, 9, 10)) OR (Q.QM_JOB_STATUS IN (12) AND Q.QM_CLOSE_DATE >=
SYSDATE - INTERVAL '6' MONTH)) ENDThat doesn't make sense. Such a plsql block would not compile. What is your final goal you want to achieve with this? -
Looking for some basics/fundamentals of XML Parsing in ABAP
Hello SAP gurus
I have to start workign on a project that involves Variant Configuration stuff that will be sent as XML document. I have to parse the XML document and save the needed data in some custom tables. I heard that there are some standard functions that we can use to do this job. I tried searching SDN for string XML parsing and got tons of postings regarding this. I tried to go through them one by one but it was way beyond my understanding at this time. I am looking for the fundamentals or how to start from scratch.
I would appreciate if anybody can guide me to find some kind tutorial or basic info on where and how to start.
Thanks a lot in advance
RamXML parsing through CALL TRANSFORMATION is one of the easiest method. A transformation needs to be created as per your XML data in transaction XSLT_TOOL and the transformation needs to be called in ABAP program using "CALL TRANSFORMATION" statement.
Kindly search in internet for XSLT/simple transformations. -
Outputting XML carriage return in HTML via XSLT
Hi,
I have a scenario where I execute a View Object query in ADF to retrieve results from a particular table in the Database. I then iterate through the results in my Java managed bean and manually construct an XML file with all the appropriate tags. I then pass the XML file through a Transformer class in the Java bean based on an XSLT I have created to produce an HTML page. However I have an issue when it comes to handling carriage returns. One of the database table columns can contain carriage returns within its value but in the final HTML page the carriage returns don't have any effect and the text just displays on one line.
In the database, the values are stored with the carriage return and in SQL Developer, Toad etc this can be seen e.g. Text1 Text2 Text3 Text4 will display on separate lines. In the XML, the carriage return seems to still be there as when I open the file my element which contains the carriage returns shows each part on a new line e.g. <textElement>Text1
Text2
Text3
Text4</textElement> (The Text2, Text3 and Text4 all start on a new line at the beginning and there's no prior white space as shown in this post)
The XML file in JDeveloper also shows carriage return arrow symbols where there is one.
The HTML page just shows them as Text1 Text2 Text3 Text4 all on one line. Inspecting the source of the HTML shows that the carriage return is in fact there as it also displays as per the XML with the values on separate lines.
Outputting the value from the View Object in Java to the log shows the value coming out like this - Text1 Text2Text3Text4, which is strange but I know the carriage returns are there so I'm not too fussed about this.
I have tried escaping the characters in the Java by doing str.replaceAll("[\\r\\n]", ""); (but replacing the "" with 
 
 or &x0A;) so in the XML it replaces carriage returns and line feeds with these escaped characters. However, when the XSLT parses the XML it doesn't pick these up and instead actually outputs these actual characters as they are e.g. Text1&x0A;Text2&x0A;Text3&x0A;Text4
So I can confirm that the carriage return is carrying all the way through to the XSL but I can't help but think that maybe I need to do something in the XSL to process this somehow, e.g. doing the equivalent of the 'replace' in Java but I don't know what I need to search for in the XML and also what to actually replace it with..Do I just replace it with a </BR> in HTML?
We also parse the XML using PDF and Excel XSL Transformer class and see the same results.
Any help would be appreciated.
ThanksThat's a very commonly asked question.
HTML doesn't preserve linefeeds, except for the <pre> tag.
You'll have to replace those characters with <BR/> tags in the XSLT.
Search the Internet for terms like "XSLT HTML LF", you'll find some XSLT sample templates to handle the replacement. -
Help need in XML to Proxy scenario
HI Guys,
I have got one scenaio from xml file --> ABAP proxy. This is for SNC integration, Product Acitivity Data. Please have a look the following xml file.
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<OUTPUT>
<TRANS_HEADER>
<SET_ID>852</SET_ID>
<CNTL_NUMB>0001</CNTL_NUMB>
<CUST_NUMB>3800580</CUST_NUMB>
</TRANS_HEADER>
<H01_XQ>
<XQ01>H</XQ01>
<XQ_Y2K_DATE1>20100601</XQ_Y2K_DATE1>
</H01_XQ>
<Group_N1>
<H02_N1>
<N101>ST</N101>
<N102>SO. CALIF.</N102>
<N103>UL</N103>
<N104>0083967005509</N104>
</H02_N1>
<H02_N1_N4>
<N401>SANBERNARDINO CALIFORNIA</N401>
<N402>CA</N402>
<N403>92407-185</N403>
</H02_N1_N4>
<H02_N1_DTM>
<DTM01>600</DTM01>
<DTM_Y2K_DATE>20100531</DTM_Y2K_DATE>
</H02_N1_DTM>
</Group_N1>
<Group_LIN>
<D01_LIN>
<LIN02>CB</LIN02>
<LIN03>225037</LIN03>
<LIN04>UA</LIN04>
<LIN05>001230035569</LIN05>
<LIN06>UK</LIN06>
<LIN07>00012300355698</LIN07>
<LIN08>ZZ</LIN08>
<LIN09>0</LIN09>
</D01_LIN>
<D01_PO4>
<P0401>10</P0401>
</D01_PO4>
<D01_N9>
<N901>VN</N901>
<N902>0000005121</N902>
</D01_N9>
<Group_ZA>
<D02_ZA>
<ZA01>QA</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QN</ZA01>
<ZA02>1.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QO</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QP</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QS</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
</Group_ZA>
</Group_LIN>
<Group_LIN>
<D01_LIN>
<LIN02>CB</LIN02>
<LIN03>225052</LIN03>
<LIN04>UA</LIN04>
<LIN05>001230035570</LIN05>
<LIN06>UK</LIN06>
<LIN07>00012300355704</LIN07>
<LIN08>ZZ</LIN08>
<LIN09>2</LIN09>
</D01_LIN>
<D01_PO4>
<P0401>10</P0401>
</D01_PO4>
<D01_N9>
<N901>VN</N901>
<N902>0000005121</N902>
</D01_N9>
<Group_ZA>
<D02_ZA>
<ZA01>QA</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QN</ZA01>
<ZA02>1.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QO</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QP</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QS</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
</Group_ZA>
</Group_LIN>
<Group_LIN>
<D01_LIN>
<LIN02>CB</LIN02>
<LIN03>225078</LIN03>
<LIN04>UA</LIN04>
<LIN05>001230035571</LIN05>
<LIN06>UK</LIN06>
<LIN07>00012300355711</LIN07>
<LIN08>ZZ</LIN08>
<LIN09>2</LIN09>
</D01_LIN>
<D01_PO4>
<P0401>10</P0401>
</D01_PO4>
<D01_N9>
<N901>VN</N901>
<N902>0000005121</N902>
</D01_N9>
<Group_ZA>
<D02_ZA>
<ZA01>QA</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QN</ZA01>
<ZA02>1.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QO</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QP</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QS</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
</Group_ZA>
</Group_LIN>
<Group_LIN>
<S01_CTT>
<CTT01>53</CTT01>
</S01_CTT>
</OUTPUT>
<OUTPUT>
<TRANS_HEADER>
<SET_ID>852</SET_ID>
<CNTL_NUMB>0001</CNTL_NUMB>
<CUST_NUMB>3800580</CUST_NUMB>
</TRANS_HEADER>
<H01_XQ>
<XQ01>H</XQ01>
<XQ_Y2K_DATE1>20100601</XQ_Y2K_DATE1>
</H01_XQ>
<Group_N1>
<H02_N1>
<N101>ST</N101>
<N102>SO. CALIF.</N102>
<N103>UL</N103>
<N104>0083967005509</N104>
</H02_N1>
<H02_N1_N4>
<N401>SANBERNARDINO CALIFORNIA</N401>
<N402>CA</N402>
<N403>92407-185</N403>
</H02_N1_N4>
<H02_N1_DTM>
<DTM01>600</DTM01>
<DTM_Y2K_DATE>20100531</DTM_Y2K_DATE>
</H02_N1_DTM>
</Group_N1>
<Group_LIN>
<D01_LIN>
<LIN02>CB</LIN02>
<LIN03>225037</LIN03>
<LIN04>UA</LIN04>
<LIN05>001230035569</LIN05>
<LIN06>UK</LIN06>
<LIN07>00012300355698</LIN07>
<LIN08>ZZ</LIN08>
<LIN09>0</LIN09>
</D01_LIN>
<D01_PO4>
<P0401>10</P0401>
</D01_PO4>
<D01_N9>
<N901>VN</N901>
<N902>0000005121</N902>
</D01_N9>
<Group_ZA>
<D02_ZA>
<ZA01>QA</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QN</ZA01>
<ZA02>1.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QO</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QP</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QS</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
</Group_ZA>
</Group_LIN>
<Group_LIN>
<D01_LIN>
<LIN02>CB</LIN02>
<LIN03>225052</LIN03>
<LIN04>UA</LIN04>
<LIN05>001230035570</LIN05>
<LIN06>UK</LIN06>
<LIN07>00012300355704</LIN07>
<LIN08>ZZ</LIN08>
<LIN09>2</LIN09>
</D01_LIN>
<D01_PO4>
<P0401>10</P0401>
</D01_PO4>
<D01_N9>
<N901>VN</N901>
<N902>0000005121</N902>
</D01_N9>
<Group_ZA>
<D02_ZA>
<ZA01>QA</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QN</ZA01>
<ZA02>1.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QO</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QP</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QS</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
</Group_ZA>
</Group_LIN>
<Group_LIN>
<D01_LIN>
<LIN02>CB</LIN02>
<LIN03>225078</LIN03>
<LIN04>UA</LIN04>
<LIN05>001230035571</LIN05>
<LIN06>UK</LIN06>
<LIN07>00012300355711</LIN07>
<LIN08>ZZ</LIN08>
<LIN09>2</LIN09>
</D01_LIN>
<D01_PO4>
<P0401>10</P0401>
</D01_PO4>
<D01_N9>
<N901>VN</N901>
<N902>0000005121</N902>
</D01_N9>
<Group_ZA>
<D02_ZA>
<ZA01>QA</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QN</ZA01>
<ZA02>1.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QO</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QP</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
<D02_ZA>
<ZA01>QS</ZA01>
<ZA02>0.0</ZA02>
<ZA03>CT</ZA03>
<ZA06>LJ</ZA06>
<ZA07>XX</ZA07>
</D02_ZA>
</Group_ZA>
</Group_LIN>
<Group_LIN>
<S01_CTT>
<CTT01>53</CTT01>
</S01_CTT>
</OUTPUT>
</ROOT>
1. Can you please tell me, Do we need Multimapping in this?
2. To take this file into PI, do we need to use Ananimity bean parameters to sender file adapter module?
3. the sender side XSD schma as follows is it okay are any change are required
ROOT Complex Type
OUTPUT Element 0..unbounded
TRANS_HEADER Element 0..unbounded
SET_ID Element xsd:string 0..1
CNTL_NUMB Element xsd:string 0..1
CUST_NUMB Element xsd:string 0..1
H01_XQ Element 0..unbounded
XQ01 Element xsd:string 0..1
XQ_Y2K_DATE1 Element xsd:date 0..1
Group_N1 Element 0..unbounded
H02_N1 Element 0..1
N101 Element xsd:string 0..1
N102 Element xsd:string 0..1
N103 Element xsd:string 0..1
N104 Element xsd:string 0..1
H02_N1_N4 Element 0..1
N401 Element xsd:string 0..1
N402 Element xsd:string 0..1
N403 Element xsd:string 0..1
H02_N1_DTM Element 0..1
DTM01 Element xsd:string 0..1
DTM_Y2K_DATE Element xsd:date 0..1
Group_LIN Element 0..unbounded
D01_LIN Element 0..unbounded
LIN02 Element xsd:string 0..1
LIN03 Element xsd:string 0..1
LIN04 Element xsd:string 0..1
LIN05 Element xsd:string 0..1
LIN06 Element xsd:string 0..1
LIN07 Element xsd:string 0..1
LIN08 Element xsd:string 0..1
LIN09 Element xsd:string 0..1
D01_PO4 Element 0..unbounded
P0401 Element xsd:integer 0..1
D01_N9 Element 0..unbounded
N901 Element xsd:string 0..1
N902 Element xsd:string 0..1
Group_ZA Element 0..unbounded
D02_ZA Element 0..unbounded
ZA01 Element xsd:string 0..unbounded
ZA02 Element xsd:decimal 0..unbounded
ZA03 Element xsd:string 0..unbounded
ZA04 Element xsd:string 0..unbounded
ZA05 Element xsd:string 0..unbounded
ZA06 Element xsd:string 0..unbounded
ZA07 Element xsd:string 0..unbounded
ZA08 Element xsd:string 0..unbounded
ZA09 Element xsd:string 0..unbounded
S01_CTT Element 0..unbounded
CTT01 Element xsd:string 0..1
Any kind if help is good.
Regards
Many thanks in advance.
SanHi Abhishek,
Any example scenario do you about this model. I will explain our scenario situation, please give me your idea.
We are doing Customer colloboration on SNC 7.0 with PI 7.11. Everyday customer sales files almost 100 comes individually EDI messages comes in EDI flat file, there is intermediate company will conver EDI flat file into xml messages. This xml file has got first 5 tags header information and the rest 50 to 100 lin items. This kind of header and lin information 3 to 5 messages per one xml.
EX: <RooT>
<OUTPUT> -- 0..unbound
<Header-1> --- 0..1
<Header-2> --- 0..1
<Line -1> 0..n
<Line -7> 0..n
<ZA> 0..1
<ZA> 0..1
<Trailer> 0..1
This is the structure. We need to populate all this customer information into Product Activity Notification on SNC 1..1.
Could you please give me your ideas and recommandations.
Many thanks for your help & effort.
Regards
San -
Dear All
I have a requirement to generate xml document from database as per given XML schema definition. I did this by using oracle report developer to generate out put as xml document.
My question is that is there any sequence important for attribute for example
XSD has attribute
Name
Address
phoneno
But When i generate xml document using oracle report developer it changes the sequence of attributes like this
phoneno
address
name
please guide that this wrong sequence of attribute have any problem when validating xml document with xsd.
RegardsXML 1.0 specifications :
http://www.w3.org/TR/REC-xml/#sec-starttags
The Name in the start- and end-tags gives the element's type. [Definition: The Name-AttValue pairs are referred to as the attribute specifications of the element], [Definition: with the Name in each pair referred to as the attribute name ] and [Definition: the content of the AttValue (the text between the ' or " delimiters) as the attribute value.] Note that the order of attribute specifications in a start-tag or empty-element tag is not significant. -
XSLT Transform XML 2 HTML does not work well
Hi,
This is my first attempt to use XSLT to convert my XML file into HTML using Java. I have included below the java code I used for the transformation, the xsl file and the xml file.
As per the xml file, I would like to display the carrier's common-name for each host. However, I can only get to display the carrier-id using the code line
<xsl:value-of select="./@carrier"/>
as shown in the last part of the xsl file, but cannot get the carrier's commonname from the carrierid using the code,
<xsl:variable name="hostCarr" select="./@carrier"/>
<xsl:variable name="hostcomName" select="id($hostCarr)/common-name"/>
<xsl:value-of select="$hostcomName"/>
However this works well if I were to use XML SPY for the conversion, instead of the Transform class in Java. I am using version 1.4.1 of Java.
Please help.
Thanks,
Prasuna
XML file
<pathinfo pathogen-name="Brucella spp.">
<taxonomy>
<carrier carrierID="wild">
<common-name>Wild cies</common-name>
</carrier>
<carrier carrierID="sheepandgoats">
<common-name>Domestic Pig</common-name>
</carrier>
<carrier carrierID="lab">
<common-name>Laboratory environment</common-name>
</carrier>
</taxonomy>
<host-list>
<host carrier="wild"></host>
<host carrier="lab"></host>
<host carrier="sheepandgoats"></host>
</host-list>
</pathinfo>
XSL file
<xsl:stylesheet version="1.0" xmlns:a="http://www.xmlspy.com/schemas/orgchart" xmlns:ipo="http://www.altova.com/IPO" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="ISO-8859-1" omit-xml-declaration="no" indent="no" media-type="text/html"/>
<xsl:template match="pathinfo">
<html>
<head><title><xsl:value-of select="@pathogen-name"/></title>
</head>
<body bgcolor="#ffffe5" text="#000000" link="#007a00" vlink="#7a0000" alink="#ff0000">
<xsl:apply-templates select="host-list"/>
</body>
</html>
</xsl:template>
<xsl:template match="host-list">
<ol>
<xsl:for-each select="host">
<li>
<xsl:variable name="hostCarr" select="./@carrier"/>
<xsl:variable name="hostcomName" select="id($hostCarr)/common-name"/>
<!--
<xsl:value-of select="./@carrier"/>
<xsl:value-of select="$hostcomName"/>
-->
<xsl:value-of select="$hostcomName"/>
</li>
</xsl:for-each>
</ol>
</xsl:template>
</xsl:stylesheet>
Java Code
import javax.xml.transform.*;
import java.net.*;
import java.io.*;
public class Xml2Html {
public static void main(String[] args) {
try {
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer =
tFactory.newTransformer
(new javax.xml.transform.stream.StreamSource
("temp.xsl"));
transformer.transform
(new javax.xml.transform.stream.StreamSource
("temp.xml"),
new javax.xml.transform.stream.StreamResult
( new FileOutputStream("temp.html")));
catch (Exception e) {
e.printStackTrace( );From Michael Kay's book "XSLT Programmer's Reference":
'A non-validating XML parser isn't required to read attribute definitions from an external DTD. In this situation the XSLT processor will assume there are no ID attributes present, and the id() function will always return an empty result."
Presumably you didn't set your transformer to use a validating parser, and I don't even see a reference to a DTD there. However the expression id('X') is equivalent to //*[@id='X'], Kay goes on to say. Try that instead. -
XML Gateway Outbound transaction error
Hi,
We are trying to send a XML file to an outside vendor using XML gateway but facing issue in doing the HTTP post.
As per the XML Gateway user guide I have setup the Hub definition with protocol type as being HTTP. protocol address as the one provided by the vendor and created a hub user.
I have also setup a 'custom' outbound transaction type.
And then setup a 'Trading Partner' linked it to the transaction type and the hub. and loaded the DTD and Map file.
I am able to generate the XML file successfully but it does not get delivered or is being rejected by the vendor.
I am trying to narrow down to if the issue exists on our end and the file is not being sent correctly or it is being rejected once it reaches the http site.
I get the following error message on looking at the underlying log table:
Response: HTTP/1.1 500 Internal Server Error
Connection: close
Date: Tue, 26 Oct 2010 19:22:10 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Cache-Control: private
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 1805
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text
xml:lang="en">System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
any help will be much much appreciated.
Thanks
AmitYes i was able to go to the URL using my machine browser. Since Oracle is installed on a linux machine i do not think I will be able to install a browser and go to the site from the oracle machine. I also tried pinging www.google.com and that seemed to work so i am sure the server is able to connect properly.
Can you suggest any other way to verify that the file is being sent out and the issue is on the other end? I was hoping if i could send the file to any other outside link that will be a good enough test of file going out of the network. -
Is JAXB the best solution to store XML schema in databse
Hi, i have a doubt regarding which is better way to store XML schema to database.
I have looked on JAXB, DOM, SAX.
I should be able to modify the database and store back the changes in XML schema..
i am really consfused about this.
plz suggest me
thanxThank you for your reply
As per as I know JAXB take XML schema as basis to
create tables in database and store the XML data
according to that . I want to store the XML Data in
the database structured according to XML schema
defined by me.I'm not sure how a schema would impact this. Schema is a data definition that constraints a given XML data document. The XML itself is stored as a string. Databases like Oracle now have XML column types and allow you to use XML querying languages and x-Path in normal SQL queries.
There are 2 types of mapping from XML to datbase
Table space and object relational
A tablespace is conceptually similar to a namespace. Object relational mappers go from objects to relational databases and back. I do not see how either of these two concepts are mutually exclusive. And the latter makes no sense if you talking about an object database. There is no O/R mapping because there is no relational database, it's an object database.
I want to do object-relational mapping from XML to
o object oriented database . and the modifications
done on the datbase want to store again in XML. As
per as I know JAXB give us classes as per the XML
schema and we can write DDL to store the data in
databse
JAXB is for marshalling and unmarshalling Java objects to and from XML. The XML itself can be stored in any LOB database column.
Is it the right approach or do you have any better
idea?I still do not really understand what you are trying to do. It seems like you have a bit too much technology soup to consume. What are the actual requirements?
- Saish -
Map several records to different elements in the same xml node
Hi,
I am trying to map data from relational tables to elements as per my xml schema. One of my tables has several records that I need to map to different elements in the same xml node.
For example:
Customer_Id | Param_Id |Param_Name
212 | 1 |State
212 | 2 |Country
212 | 3 |ZipCode
I can not change the structure of this existing table and need to work with it.
How do I map the different params for a specific customer to my Customer node in the schema?
One option is to join on the parameters table several times, but there ought to be a better way!
PLEASE HELP!!!
Thanks,First I question the design that contains/allows 600 attributes on an element. They sound like they really should be elements in the XML.
Regardless, the following (NOT TESTED) should work for you (assuming you want to write one SQL with 600 columns)
CREATE OR REPLACE VIEW APPLICATION_XML
OF XMLTYPE
Element "LOAN_APPLICATION"
with object ID
substr(extractValue(object_value,'/LOAN_APPLICATION/APPLICATION_DATA/@CallID'),1,5)
AS
WITH parm_tb AS
SELECT MAX(DECODE(prv_valu, 1, prv_value)) BusinessType,
MAX(DECODE(param_id, 2, prv_value)) Product,
MAX(DECODE(param_id, 3, prv_value)) SomethingElse
FROM parameter_details
WHERE prv_pmh_header_id = 1
SELECT xmlElement
("APPLICATION_DATA",
xmlAttributes
p.prv_detail_id as "CallID",
p.PRV_PRM_PARAM_ID as "RandomID",
p.prv_value as AppInitDate
xmlElement
("PRODUCER_DATA",
xmlAttributes
parm_tb.BusinessType as "BusinessType" ,
parm_tb.Product as "Product"
FROM parameters_table p
WHERE p.PRV_PMH_HEADER_ID = 1 -
Hi all,
I am pretty new to xi. I have a business requirement, where the 3rd party will be sending us an xml file. How can I process this into XI? Can this be done in a file adapter?
Please help. thanks in advance.Hi Paul,
You have to use File adapter to read xml file.
What is your target? Is it Idoc? RFC?
You have to create data type as per your xml structure.
Check these links for more details
[Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part I|Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part I]
[Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part II|Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part II]
[Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part III|Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part III] -
Hi,
xml data with contains attribute values.
XML Data:
<chapter>
<div class="figure" id="s9781452281988.n9.i73">
<p class="fig-caption" name="Figure 9.2.">Prevention of, and Treatment for, Mental Health, Substance Abuse, and Family Conflict</p>
<img src="10.4135_9781452281988-fig0902.jpg" alt="Figure 9.2. Prevention of, and Treatment for, Mental Health, Substance Abuse, and Family Conflict"/>
</div>
</chapter>
JavaScript:
var myDoc = app.activeDocument;
var myGlueCodePath = app.filePath + "/Scripts/XML Rules/glue code.jsx";
var myFile = File(myGlueCodePath);
app.doScript(myFile);
if (app.documents.length != 0) {
var myRuleSet = new Array(
new findObjAttribute("//*")
with(myDoc) {
var elements = xmlElements;
__processRuleSet(elements.item(0), myRuleSet);
else{
alert("You have no document open!");
exit();
function findObjAttribute(){
this.name = "findObjAttribute";
this.xpath = ("//div[@class='figure']//p[@class='fig-caption']");
this.apply = function(myElement, myRuleProcessor)
var elmName=myElement.markupTag.name;
with(myElement){
try {
var myAttName=myElement.xmlAttributes.itemByName("name").value;
$.writeln(myAttName);
}catch(e){};
my Problem is After import xml in to InDesign i will get output like:
Prevention of, and Treatment for, Mental Health, Substance Abuse, and Family Conflict
But am expecting with attribute name following contents
Figure 9.2 Prevention of, and Treatment for, Mental Health, Substance Abuse, and Family Conflict
can any one modify my Script
HurixHi Hurix,
For these types of autogeneration you need to use XSLT not "scripting".
When you export to XML the content will appear, as per final XML that should be stripped out.
Before importing into indesign run through XSLT and import the XML.
Using XSLT:
1. You can map all the para/character style
2. All autogeneration content will be handled
3. Commenting of element for display purpose
4. Converting Tables to Indesign Compitable tables
etc...
Shaji -
Hi,
I want to load a XML document in structured XMLType. You can run my code on your database if you have a directory object called LOG_DIR. I am on Oracle 10.1 .
The schema is a simple example which describe a database table(like it will have 1 or more columns and 0 or more indexes). My schema looks like,
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Tables" type="Table">
<xs:annotation>
<xs:documentation>Table defination</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="table_name" type="xs:string"/>
<xs:complexType name="Table">
<xs:sequence>
<xs:element name="Column" type="Column" minOccurs="1"/>
<xs:element name="Index" type="Index" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Column">
<xs:annotation>
<xs:documentation>Column of the table</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Name" type="xs:string" minOccurs="1"/>
<xs:element name="Type" type="xs:string" minOccurs="1"/>
<xs:element name="Capacity" type="xs:decimal" minOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Index">
<xs:annotation>
<xs:documentation>Index on the table</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Name" type="xs:string" minOccurs="1"/>
<xs:element name="Type" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
I registered the schema,
BEGIN
DBMS_XMLSCHEMA.registerSchema(
SCHEMAURL => 'tables.xsd',
SCHEMADOC => bfilename('LOG_DIR','tables.xsd'),
CSID => nls_charset_id('AL32UTF8')
END;
This was successfull, also the following create table was ok,
CREATE TABLE TMP_XML_TABLES
file_name VARCHAR2(2000),
load_date DATE,
xml_document XMLType
XMLType COLUMN xml_document
XMLSchema "http://xmlns.oracle.com/xdb/schemas/TDB/tables.xsd"
ELEMENT "Tables";
Now I have a XML document,
<Tables xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/xdb/schemas/TDB/tables.xsd">
<table_name>trades</table_name>
<Column><Name>trade_id</Name><Type>varchar2</Type><Capacity>50</Capacity></Column>
<Column><Name>source</Name><Type>varchar2</Type><Capacity>100</Capacity></Column>
<Column><Name>trade_date</Name><Type>date</Type></Column>
<Column><Name>trader</Name><Type>varchar2</Type><Capacity>200</Capacity></Column>
<Index><Name>trades_pk</Name><Type>btree</Type></Index>
<Index><Name>trades_idx1</Name><Type>bitmap</Type></Index>
</Tables>
When I am trying to load this, I get the error,
SQL> INSERT INTO TMP_XML_TABLES
2 VALUES
3 ('tables1.xml',
4 sysdate,
5 XMLType
6 (
7 bfilename('LOG_DIR','tables1.xml'),
8 nls_charset_id('AL32UTF8')
9 )
10 );
INSERT INTO TMP_XML_TABLES
ERROR at line 1:
ORA-19007: Schema - does not match expected tables.xsd.
Can somebody please explain the cause ???
Thanks and RegardsA quick search of the forum for ORA-19007 should have allowed you to find the answer to your problem. Since you XML Schema does not declare a target namespace you need to use the xsi:noNamespaceSchemaLocation tag rather than the schemaLocation tag..
Also please do not use URLs starting http://xmlns.oracle.com for your schemaLocation hint. If you do no own your own domain I'd suggest example.org...
Finally please make sure that your XML Instance is valid per your XML Schema before posting. You can do this using tools like JDeveloper or XMLSpy. What should have been a 5 min repsonse took me over 20 mins to work through due to the errors in the XML Schema...
Anyway here's a working example for you
SQL>
SQL>
SQL> var schemaURL varchar2(256)
SQL> var schemaPath varchar2(256)
SQL> --
SQL> begin
2 :schemaURL := 'http://xmlns.examples.org/xdb/schemas/TDB/tables.xsd';
3 :schemaPath := '/public/testcase.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> DROP TABLE TMP_XML_TABLES
2 /
Table dropped.
SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
2 /
Call completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="
tp://xmlns.oracle.com/xdb">
5 <xs:element name="Tables" xdb:defaultTable="TABLES_TABLE">
6 <xs:annotation>
7 <xs:documentation>Table defination</xs:documentation>
8 </xs:annotation>
9 <xs:complexType>
10 <xs:complexContent>
11 <xs:extension base="Table"/>
12 </xs:complexContent>
13 </xs:complexType>
14 </xs:element>
15 <xs:complexType name="Table">
16 <xs:sequence>
17 <xs:element name="table_name" type="xs:string"/>
18 <xs:element name="Column" type="Column" maxOccurs="unbounded"/>
19 <xs:element name="Index" type="Index" minOccurs="0" maxOccurs="unbounded"/>
20 </xs:sequence>
21 </xs:complexType>
22 <xs:complexType name="Column">
23 <xs:annotation>
24 <xs:documentation>Column of the table</xs:documentation>
25 </xs:annotation>
26 <xs:sequence>
27 <xs:element name="Name" type="xs:string"/>
28 <xs:element name="Type" type="xs:string"/>
29 <xs:element name="Capacity" type="xs:decimal"/>
30 </xs:sequence>
31 </xs:complexType>
32 <xs:complexType name="Index">
33 <xs:annotation>
34 <xs:documentation>Index on the table</xs:documentation>
35 </xs:annotation>
36 <xs:sequence>
37 <xs:element name="Name" type="xs:string"/>
38 <xs:element name="Type" type="xs:string" minOccurs="0"/>
39 </xs:sequence>
40 </xs:complexType>
41 </xs:schema>
42 ');
43 begin
44 if (dbms_xdb.existsResource(:schemaPath)) then
45 dbms_xdb.deleteResource(:schemaPath);
46 end if;
47 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
48 end;
49 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 TRUE,TRUE,FALSE,TRUE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> CREATE TABLE TMP_XML_TABLES
2 (
3 file_name VARCHAR2(2000),
4 load_date DATE,
5 xml_document XMLType
6 )
7 XMLType COLUMN xml_document
8 XMLSchema "http://xmlns.examples.org/xdb/schemas/TDB/tables.xsd"
9 ELEMENT "Tables"
10 /
Table created.
SQL> insert into TMP_XML_TABLES values ('testcase1.xml',sysdate,xmltype(
2 '<Tables xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.examples.org/xdb/schemas/T
/tables.xsd">
3 <table_name>trades</table_name>
4 <Column>
5 <Name>trade_id</Name>
6 <Type>varchar2</Type>
7 <Capacity>50</Capacity>
8 </Column>
9 <Column>
10 <Name>source</Name>
11 <Type>varchar2</Type>
12 <Capacity>100</Capacity>
13 </Column>
14 <Column>
15 <Name>trade_date</Name>
16 <Type>date</Type>
17 </Column>
18 <Column>
19 <Name>trader</Name>
20 <Type>varchar2</Type>
21 <Capacity>200</Capacity>
22 </Column>
23 <Index>
24 <Name>trades_pk</Name>
25 <Type>btree</Type>
26 </Index>
27 <Index>
28 <Name>trades_idx1</Name>
29 <Type>bitmap</Type>
30 </Index>
31 </Tables>'))
32 /
1 row created.
SQL> set long 10000 pages 0 lines 160
SQL> /
1 row created.
SQL> select * from TMP_XML_TABLES
2 /
testcase1.xml
21-APR-06
<Tables xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.examples.org/xdb/schemas/TDB/tab
s.xsd">
<table_name>trades</table_name>
<Column>
<Name>trade_id</Name>
<Type>varchar2</Type>
<Capacity>50</Capacity>
</Column>
<Column>
<Name>source</Name>
<Type>varchar2</Type>
<Capacity>100</Capacity>
</Column>
<Column>
<Name>trade_date</Name>
<Type>date</Type>
</Column>
<Column>
<Name>trader</Name>
<Type>varchar2</Type>
<Capacity>200</Capacity>
</Column>
<Index>
<Name>trades_pk</Name>
<Type>btree</Type>
</Index>
<Index>
<Name>trades_idx1</Name>
<Type>bitmap</Type>
</Index>
</Tables>
testcase1.xml
21-APR-06
<Tables xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.examples.org/xdb/schemas/TDB/tab
s.xsd">
<table_name>trades</table_name>
<Column>
<Name>trade_id</Name>
<Type>varchar2</Type>
<Capacity>50</Capacity>
</Column>
<Column>
<Name>source</Name>
<Type>varchar2</Type>
<Capacity>100</Capacity>
</Column>
<Column>
<Name>trade_date</Name>
<Type>date</Type>
</Column>
<Column>
<Name>trader</Name>
<Type>varchar2</Type>
<Capacity>200</Capacity>
</Column>
<Index>
<Name>trades_pk</Name>
<Type>btree</Type>
</Index>
<Index>
<Name>trades_idx1</Name>
<Type>bitmap</Type>
</Index>
</Tables>Since you are tracking metadata about the documents (name, date loaded) you might want to consider using the XDB repository to load the documents. The folllowing shows how you can do this from SQL and then create a view which contains the metadata and document content. The advantage of this approach is you can now load the documents using FTP or WebDAV.
SQL> declare
2 res boolean;
3 document xmltype := xmltype(
4 '<Tables xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.examples.org/xdb/schemas/T
/tables.xsd">
5 <table_name>trades</table_name>
6 <Column>
7 <Name>trade_id</Name>
8 <Type>varchar2</Type>
9 <Capacity>50</Capacity>
10 </Column>
11 <Column>
12 <Name>source</Name>
13 <Type>varchar2</Type>
14 <Capacity>100</Capacity>
15 </Column>
16 <Column>
17 <Name>trade_date</Name>
18 <Type>date</Type>
19 </Column>
20 <Column>
21 <Name>trader</Name>
22 <Type>varchar2</Type>
23 <Capacity>200</Capacity>
24 </Column>
25 <Index>
26 <Name>trades_pk</Name>
27 <Type>btree</Type>
28 </Index>
29 <Index>
30 <Name>trades_idx1</Name>
31 <Type>bitmap</Type>
32 </Index>
33 </Tables>');
34 begin
35 res := dbms_xdb.createResource('/public/testcase.xml',document);
36 end;
37 /
PL/SQL procedure successfully completed.
SQL> create or replace view TMP_XML_TABLES_VIEW as
2 select extractValue(res,'/Resource/DisplayName') FILENAME,
3 extractValue(res,'/Resource/CreationDate') LOAD_DATE,
4 object_value XML_DOCUMENT
5 from RESOURCE_VIEW, TABLES_TABLE t
6 where extractValue(res,'/Resource/XMLRef')= ref(t)
7 /
View created.
SQL> select * from TABLES_TABLE
2 /
<Tables xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.examples.org/xdb/schemas/TDB/tab
s.xsd">
<table_name>trades</table_name>
<Column>
<Name>trade_id</Name>
<Type>varchar2</Type>
<Capacity>50</Capacity>
</Column>
<Column>
<Name>source</Name>
<Type>varchar2</Type>
<Capacity>100</Capacity>
</Column>
<Column>
<Name>trade_date</Name>
<Type>date</Type>
</Column>
<Column>
<Name>trader</Name>
<Type>varchar2</Type>
<Capacity>200</Capacity>
</Column>
<Index>
<Name>trades_pk</Name>
<Type>btree</Type>
</Index>
<Index>
<Name>trades_idx1</Name>
<Type>bitmap</Type>
</Index>
</Tables>
SQL> select * from TMP_XML_TABLES_VIEW
2 /
testcase.xml
21-APR-06 02.21.37.031000 PM
<Tables xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.examples.org/xdb/schemas/TDB/tab
s.xsd">
<table_name>trades</table_name>
<Column>
<Name>trade_id</Name>
<Type>varchar2</Type>
<Capacity>50</Capacity>
</Column>
<Column>
<Name>source</Name>
<Type>varchar2</Type>
<Capacity>100</Capacity>
</Column>
<Column>
<Name>trade_date</Name>
<Type>date</Type>
</Column>
<Column>
<Name>trader</Name>
<Type>varchar2</Type>
<Capacity>200</Capacity>
</Column>
<Index>
<Name>trades_pk</Name>
<Type>btree</Type>
</Index>
<Index>
<Name>trades_idx1</Name>
<Type>bitmap</Type>
</Index>
</Tables>
SQL>
SQL>
SQL>
Maybe you are looking for
-
CFOP aparecendo na Nota Fiscal de Serviço
Pessoal, bom dia! Estamos num projeto de implementação da NFe 3.10 e atualização de Support Package e deparamos com a seguinte situação: No lançamento de uma nota fiscal de serviço, com um IVA de serviço, o campos cfop, utilização do material e orig
-
i used to have itunes on this computer once before, but when my old ipod broke i unistalled it. i found my other ipod so decided to reinstall itunes and it comes up with an error saying that it can't delete former itunes files, how do i fix that?
-
Storing photos in iCloud, help needed.
Using my iPad I moved photos from photostream into iCloud, I created albums. Yet when I go into iCloud using my iPhone there's no sign of the albums.....anyone know why? I thought once yous tired photos in albums in iCloud you could view them from an
-
Hi: I have a really annoying problem. command C andV stop working just in Microsoft Word. what should i do?i can't use them as shortcut keys in word documents! however they are working in other applications, the problem is just in word documents!
-
Rendering of css different in Firefox vs IE8
I created an external style sheet to define a:link (color light grey), a:visited (light purple), a:hover (light red) and a:active (also light red) to apply to a text and an associated image's border. Firefox renders it correctly but IE8 does not ass