XML Parser - Reading an XML document into the DocumentObject
Hi guys,
I have been trying to read an XML file and feed it into the XMLParser.
I have read about the DOM API, and i can work with the DOM API in java
scripts. How
will i play with it in TOOL implementation of DOM API. Can anyone guide me
in this
process.
Thanks for your help.
Laks
Sorry for this post, here ist the complete text.
Is it possible to create a XML Parser (javax.xml.parsers.SaxParser or javax.xml.parsers.DocumentBuilder) which reads from a ByteChannel?
Example:
java.nio.channels.FileChannel fc = new ...;
javax.xml.parsers.SaxParser parser = ...;
org.xml.sax.HandlerBase hb = ...;
parser.parse( fc, hb );
Similar Messages
-
Can I append an XML Document into another?
I have a large xml document which I open into coldfusion (mx
7), and then a smaller group of files that are opened into thier
own xml objects. After some customization of xml text values, I
want to append the smaller xml documents into the larger document
at specific positions within the document tree.
I have the code that I thought would do this, using an
arrayappend function, but what happens is that only the root
element of the smaller (inserted) xml document is placed into the
main document.
Is this possible, or do I need to modify the code so that the
entire tree of xml data that I am appending is created on the
fly?Personally I do this with XSLT.
<cfxml variable="doc1">
<root>
<member id="10">
<name>Ian</name>
<sex>male</sex>
</member>
</root>
</cfxml>
<cfxml variable="doc2">
<root>
<member id="1">
<name>Joe</name>
<sex>male</sex>
</member>
<member id="2">
<name>John</name>
<sex>male</sex>
</member>
<member id="3">
<name>Sue</name>
<sex>female</sex>
</member>
</root>
</cfxml>
<cffile action="write" file="#expandPath("/")#\doc2.xml"
output="#ToString(doc2)#" nameconflict="overwrite">
<!--- METHOD ONE using a depreciated and undocumented
method --->
<cfset newNode = doc1.root.member.cloneNode(true)>
<cfset doc2.changeNodeOwner(newNode)>
<cfset doc2.root.appendChild(newNode)>
<cfdump var="#doc2#" label="Merged by hidden functions"
expand="no">
<!--- METHOD TWO using XSLT --->
<!--- create an xsl docutment--->
<cfoutput>
<cfsavecontent variable="transformer">
<xsl:stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml"/>
<!--load the merge file -->
<xsl:variable name="emps"
select="document('#expandPath("/")#\doc2.xml')"/>
<!--- this line references and XML file to be combined
with the main file,
I wonder if there is a way to use an XML document in memory
here? --->
<!-- combine the files -->
<xsl:template match="/">
<root>
<!-- select all the child nodes of the root tag in the
main file -->
<xsl:for-each select="root/child::*">
<!-- copy the member tag -->
<xsl:copy-of select="."/>
</xsl:for-each>
<!-- and all the child nodes of the root tag in the merge
file -->
<xsl:for-each select="$emps/root/child::*">
<!-- copy the member tag -->
<xsl:copy-of select="."/>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>
</cfsavecontent>
</cfoutput>
<!--- create a combined xml document --->
<cfset doc2 = XMLparse(XMLtransform(doc1,transformer))>
<cfdump var="#doc2#" label="Merged by XSLT"
expand="no"> -
How to ftp XML document into a XML type which is not created by itself.
Hi,
1.
I have a table call SNPLEX_DESIGN which is created automaticly when I register a snplex_design.xsd XML schema.( Oracle creates it through the xdb:defaultTable="SNPLEX_DESIGN attribute). and it is created using SNPLEX user account.
2.
I also created a folder (resource) call /home/SNPLEX/Orders. which is used to hold all the incoming XML document.
3.
I created another user account call SNPLEX_APP, which is the only user account allowed to FTP XML document into /home/SNPLEX/Orders folder.
Isuues,
If I login as SNPLEX user, I can ftp XML document into the folder and TABLE (the file size = 0). But If I login as SNPLEX_APP user account, I can only ftp XML document into the folder, but Oracle doesn't store the document into the table( becuase the files size shows a number).
I have granted all the ACL privileges on the /home/SNPEX/Orders folder to SNPLEX_APP hrough OEM.
DO I miss anything. Any helps will be great appreciated. Resolve this issues is very import to us, sicne we are on a stage to roll system into production.
Regards,
JinsenIN order for a registered schema to be available to other users the schema must be registered as a GLOBAL, rather than a LOCAL Schema. This is controlled by the third agument passed to registerSChema, and the default is local. Note that you will also need to explicity grant appropriate permissions on any tables created by the schema registration process to other users who will be loading or reading data from these tables.
-
How to import a XML file into the document?
Hai,
i had created a table using xml file....
Now i want to import that xml file tabel into the document...
Can any one tell me how to import the xml file into the document?
thanks
senthilHai...
this is senthil...
i'm beginner for creating adobe indesign plugins..
i want to import a html file in the document...
i want to create a table by using html tags and
that table will be imported into the document..
How shall i do it?
can any one plzz explain me? -
How to split XML document into two
I want to create new docuemnt by taking part of the existent XML document under the node document_text
vNodeList := xmldom.getElementsByTagName(vdoc, 'document_text');
vNode := xmldom.item(vNodeList, 0); -- The xmldom.getNodeName(vNode) of this node is exactly what i am
-- looking for
vdoc:= xmldom.makeDocument( vNode);
insert into cltab values (empty_clob()) returning cl into cl;
xmldom.writeToClob(vdoc_txt, cl);
But after that i am still getting the whole document tree, - copy of the whole document.
What am i doing wrong? What functions should i use for this kind of task? xmldom.clonenode?
Could you recommend any good description of the xmldom package?
Thanks,
RomanIf you are using an FI entry F-43 to generate invoice this can be done by giving the same invoice ref. in the Inv. Ref. field for two vendors. This is manual
Document Split will split the document between two profit center and not between vendors. -
To load an XML document into 40 tables
How do I load a large XML document into 40 tables. Most of the exmaples, I see only load one table into the Orcale database?
From the above document:
Storing XML Data Across Tables
Question
Can XML- SQL Utility store XML data across tables?
Answer
Currently XML-SQL Utility (XSU) can only store to a single table. It maps a canonical representation of an XML document into any table/view. But of course there is a way to store XML with the XSU across table. One can do this using XSLT to transform any document into multiple documents and insert them separately. Another way is to define views over multiple tables (object views if needed) and then do the inserts ... into the view. If the view is inherently non-updatable (because of complex joins, ...), then one can use INSTEAD-OF triggers over the views to do the inserts.
-- I've tried this, works fine. -
How to map an large XML document to the XMLType with TopLink in JDev
Hello!
We need to map an XML document in the Java String to an XMLType column. If the XML document has less than 4000 characters, we have no problems by using the DirectToField mapping. However, once the XML document has more than 4000 characters, using the DirectToField mapping, we got the error: Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.BatchUpdateException: ORA-01461: can bind a LONG value only for insert into a LONG column
Then we have tried to use the "Type Conversion" mapping, to map it to the database type (Clob or NClob --oracle.toplink.oraclespecific). we got:
Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-00932: inconsistent datatypes: expected NUMBER got CLOB
Error Code: 932
Any suggestions?
Thanks in advance!Thanks Matt! It works fine by using DirectToXMLTypeMapping.
However, to get it work is not smooth. In particularly, we use Jdev in our project and Jdev has not included this feature yet. Therefore, I had to use the TopLink Workbench to create the descriptor file and cut&paste to the description file that generated by JDev. And also xdb.jar has to be part of the classpath.
Then I come to an question -- how can we take some features that only provided by the TopLink Workbench into the Jdev environment without having to hack around?
Thanks,
s.c. -
Exception when inserting a XML document into database
Hello.
I'm trying to insert the content of a XML document into a database. The problem consists on the exception that is raised when a FK in the XML is not in the database as a PK
How can i catch these exceptions and continuing inserting the rest of the data
Thanks in advance ...I really hope for you this wasn't a production database, as mentioned in the URL, it has been some years ago for me fiddling around this which was btw a supported metalink workaround ONCE (during my Oracle 7 days), but now, I wouldn't be surprised if you now have mixed NLS content in your tables/database and more or less "corrupted" your content.
The initial issue was probably a client one.
BTW
I actually hope it was a production database, maybe then you would learn that way, that you SHOULD NEVER EVER UPDATE DATABASE BASE TABLES directly...
...unless (the only exception) you want to learn something about the internals and don't care that your TEST database gets corrupted.... -
How to convert Xml Document into orcale tempary table
i am creating xml document into java and passing this xml into oracle database and i need to fetch this xml into result set | rowset.
Xml Structure
<Department deptno="100">
<DeptName>Sports</DeptName>
<EmployeeList>
<Employee empno="200"><Ename>John</Ename><Salary>33333</Salary>
</Employee>
<Employee empno="300"><Ename>Jack</Ename><Salary>333444</Salary>
</Employee>
</EmployeeList>
</Department>
i need like this format
Deptno DeptName empno Ename Salary
100 Sports 200 Jhon 2500
100 Sports 300 Jack 3000It does depend on your version as odie suggests.
Here's a way that will work in 10g...
SQL> ed
Wrote file afiedt.buf
1 with t as (select xmltype('<Department deptno="100">
2 <DeptName>Sports</DeptName>
3 <EmployeeList>
4 <Employee empno="200"><Ename>John</Ename><Salary>33333</Salary>
5 </Employee>
6 <Employee empno="300"><Ename>Jack</Ename><Salary>333444</Salary>
7 </Employee>
8 </EmployeeList>
9 </Department>
10 ') as xml from dual)
11 --
12 -- End of test data, Use query below
13 --
14 select x.deptno, x.deptname
15 ,y.empno, y.ename, y.salary
16 from t
17 ,xmltable('/'
18 passing t.xml
19 columns deptno number path '/Department/@deptno'
20 ,deptname varchar2(10) path '/Department/DeptName'
21 ,emps xmltype path '/Department/EmployeeList'
22 ) x
23 ,xmltable('/EmployeeList/Employee'
24 passing x.emps
25 columns empno number path '/Employee/@empno'
26 ,ename varchar2(10) path '/Employee/Ename'
27 ,salary number path '/Employee/Salary'
28* ) y
SQL> /
DEPTNO DEPTNAME EMPNO ENAME SALARY
100 Sports 200 John 33333
100 Sports 300 Jack 333444
SQL>If the XML is a string e.g. a CLOB then it can easily be converted to XMLTYPE using the XMLTYPE function. -
Which utility - to input XML objects into the Apps through an API
Hello.
We are just starting on XML Publisher in 11i10.2. We will need to automate the migration of saving templates into the apps through scripting so that new development can be migrated up our test environments and into production without human intervention.
Is anyone aware of where we can find information on utility to input XML objects into the Apps through an API?
Thank you.Hi all,
You can download this document from the following location as long as Tim doesnot publishes it as a Metalink note :-o).
The URL is:
http://yuvi.esmartdesign.com/index.htm
Navigate to the downloads section and check the XML Publisher section under it for the document.
This document shall be available for a limited amount of time :-o)
Hope this helps all.
Thx,
Nitin -
Open .xml documents into InDesign?
Is there a way to open .xml documents into InDesign, or any Adobe program?
The goal is to access text from a web site feed and place it in an Indesign doc, to create a print product.You can't open XML but you can certainly utilize it.
Here's a good book you might want to look into: http://amzn.to/i3iWZ5
Bob -
XML document into multiple tables
How to insert a xml document into multiple tables. Eg. Purchase Order having multiple line items. I have to insert xml document into Parent as well as child with different sets of columns.
I created the tables using the create_ch14_tables.sql. I call it using java -classpath .;C:\commerceone\xpc\lib\xmlparserv2.jar;C:\commerceone\xpc\lib\classes12.zip;C:\commerceone\xpc\lib\xsu12.jar XMLLoader -file deptempdepend.xml -connName default -transform deptempdepend.xsl. The code doesn't seem to like the "<xsl:for-each select="Department">" tags. If I remove them, the insDoc.getDocumentElement().getFirstChild() will find the element, but it still doesn't insert anything into the database.
Thank You,
Dave -
XML document with the folder heirarchy
Can you create an XML document having the current heirarchy of folders and all their custom attributes in IFS. If yes HOW? If no what other way is there to get all the folders and their custom attributes.
nullYes, it is possible to create a folder hierarchy with custom attributes via XML in iFS.
You would first create an XML type definition file for one or more extended folder types with the corresponding custom attributes. Then, you would create instances of your custom folder types. The values of the custom attributes would be supplied as the values of elements which correspond to thos attributes. The parent folder of each instance would be specified using the <FOLDERPATH> element.
Instructions and examples are provided in the Oracle iFS Developer's Guide, chapter 4. Although this chapter illustrates how to extend the Document class, and create instances of Documents, the same can be done with Folders. -
Existing XML documents into KM
Hello Everyone
Is there a way to load existing xml documents into KM and then maintain them using xml forms built using the form builder. Any help is greatly appreciated.
Thanks
SwethaHi Renuka
You can move the XML projects from one server to another.The Xml forms created is stored in the path 'etc\xmlforms' in KM. You can send it out and Upload to the target server instead of creating the same in the Target server from the scratch.
Regards
Geogi -
Upload an XML file into the Internal table
Hi Guys,
I want to know, how to upload an xml file into the Internal table through ABAP programmingyou just wanted to load the xml file into internal table (as a table of binary strings)or load the xml data mapped to itab row columns
for the first one you can simply use gui_upload
and for the second one you need to load the xml file using gui_upload and use XLST program to transform into an itab
Regards
Raja
Maybe you are looking for
-
Having Problems opening After Effects CC
Having Problems opening After Effects CC - wont open and I get an error message 0cx00000005
-
Internal note and Vendor text to R/3 PO
HI All, I need your help in implementing this process. We are in SRM 4.0, using extended classic scneraio. Internal notes or Vendor text entered in the shopping cart is getting transfered to the text of EBP PO item. But is it not getting copied over
-
Inheritance and mouse handler problem
I have a super class and two subclass which is extend the super class. I add a mouse handler in one of the subclass. The problem is that the other subclass also affect by the mouse handler. How can i avoid that?? here is the code public abstract clas
-
Media Explorer doesn't let me add album
I know how to do it and everything. Just change the view to "album" and drag and drop a .jpg on it. I try it, however, and nothing happens. I get the "plus" sign when I drag the picture onto the symbol of a record and a note. But when I let go, the "
-
No more details needed - there was a good feature added to F5 which I can't find in F6; if it's still available, how do I set it up? Thanks.