Signing a XML Doc
Hi All,
Can any one give me sample code for signing a xml doc using oracle security developer tools.
Thanks,
Iceman
Searching the forum or Java Security documentation would've resulted in many examples, but here is a self-contained one:
XML dsig: Can I sign a SignatureProperty of the Signature?
Arshad Noor
StrongAuth, Inc.
Similar Messages
-
I got an email with a XML doc and can't open it?
How or can i open an XML doc in an email. I downloaded it but can't get it open.
I would ask them for a file in a format that is commonly used, like PDF.
I really don't think that is what they intended to send to you.
There isn't a defined program to "open" an XML document, so expecting someone to be able to open and sign it is pretty silly. XML is unformatted data. See here: http://www.w3schools.com/xml/default.asp
The likely have a program that creates forms using XML. They sent you the raw markup instead of exporting it to a PDF or other useful format. -
Error While Loading XMl Doc into Oracle Database 10g
Hi all,
I have a task that , I have to make a utillity by which we can load XML Doc into a Table. While searching on Internet i found following Procedure on ASK Tom
CREATE OR REPLACE
procedure insert_xml_emps(
p_directory in varchar2, p_filename in varchar2, vtableName in varchar2 )
as
v_filelocator bfile;
v_cloblocator clob;
l_ctx dbms_xmlsave.ctxType;
l_rows number;
begin
dbms_lob.createtemporary(v_cloblocator,true);
v_filelocator := bfilename(p_directory, p_filename);
dbms_lob.open(v_filelocator, dbms_lob.file_readonly);
DBMS_LOB.LOADFROMFILE(v_cloblocator, v_filelocator,
dbms_lob.getlength(v_filelocator));
l_ctx := dbms_xmlsave.newContext(vTableName);
l_rows := dbms_xmlsave.insertxml(l_ctx,v_cloblocator);
dbms_xmlsave.closeContext(l_ctx);
dbms_output.put_line(l_rows || ' rows inserted...');
dbms_lob.close(v_filelocator);
DBMS_LOB.FREETEMPORARY(v_cloblocator);
end ;
when i try to run this procedure
BEGIN
insert_xml_emps('XML_LOAD','load.xml','IBSCOLYTD');
END;
it gaves me following Error
ORA-29532: java call terminated by uncaught java exception : Oracle.xml.sql.OracleXMLSQLException:No
rows to modify-- the row enclosing tag missing. Specify the correct row enclosing tag.
ORA-06512: at "SYS.DBMS_XMLSAVE", line 115
ORA-06512: at "EXT_TEST.INSERT_XML_EMPS", line 18
ORA-06512: at line 2
Can anyone describe me this error
Thanks.
Best Regards.SQL> /* Creating Your table */
SQL> CREATE TABLE IBSCOLYTD
2 (
3 ACTNOI VARCHAR2 (8),
4 MEMONOI NUMBER (7,0),
5 MEMODTEI DATE,
6 AMOUNTI NUMBER (8,0),
7 BRCDSI NUMBER (4,0),
8 TYPEI NUMBER (4,0),
9 TRANSMONI NUMBER (6,0)
10 );
Table created.
SQL> CREATE OR REPLACE PROCEDURE insert_xml_emps(p_directory in varchar2,
2 p_filename in varchar2,
3 vtableName in varchar2) as
4 v_filelocator BFILE;
5 v_cloblocator CLOB;
6 l_ctx DBMS_XMLSTORE.CTXTYPE;
7 l_rows NUMBER;
8 v_amount_to_load NUMBER;
9 dest_offset NUMBER := 1;
10 src_offset NUMBER := 1;
11 lang_context NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
12 warning NUMBER;
13 BEGIN
14 dbms_lob.createtemporary(v_cloblocator, true);
15 v_filelocator := bfilename(p_directory, p_filename);
16 dbms_lob.open(v_filelocator, dbms_lob.file_readonly);
17 v_amount_to_load := DBMS_LOB.getlength(v_filelocator);
18 --- ***This line is changed*** ---
19 DBMS_LOB.LOADCLOBFROMFILE(v_cloblocator,
20 v_filelocator,
21 v_amount_to_load,
22 dest_offset,
23 src_offset,
24 0,
25 lang_context,
26 warning);
27
28 l_ctx := DBMS_XMLSTORE.newContext(vTableName);
29 DBMS_XMLSTORE.setRowTag(l_ctx, 'ROWSET');
30 DBMS_XMLSTORE.setRowTag(l_ctx, 'IBSCOLYTD');
31 -- clear the update settings
32 DBMS_XMLStore.clearUpdateColumnList(l_ctx);
33 -- set the columns to be updated as a list of values
34 DBMS_XMLStore.setUpdateColumn(l_ctx, 'ACTNOI');
35 DBMS_XMLStore.setUpdateColumn(l_ctx, 'MEMONOI');
36 DBMS_XMLStore.setUpdatecolumn(l_ctx, 'MEMODTEI');
37 DBMS_XMLStore.setUpdatecolumn(l_ctx, 'AMOUNTI');
38 DBMS_XMLStore.setUpdatecolumn(l_ctx, 'BRCDSI');
39 DBMS_XMLStore.setUpdatecolumn(l_ctx, 'TYPEI');
40 DBMS_XMLStore.setUpdatecolumn(l_ctx, 'TRANSMONI');
41 -- Now insert the doc.
42 l_rows := DBMS_XMLSTORE.insertxml(l_ctx, v_cloblocator);
43 DBMS_XMLSTORE.closeContext(l_ctx);
44 dbms_output.put_line(l_rows || ' rows inserted...');
45 dbms_lob.close(v_filelocator);
46 DBMS_LOB.FREETEMPORARY(v_cloblocator);
47 END;
48 /
Procedure created.
SQL> BEGIN
2 insert_xml_emps('TEST_DIR','load.xml','IBSCOLYTD');
3 END;
4 /
PL/SQL procedure successfully completed.
SQL> SELECT * FROM ibscolytd;
ACTNOI MEMONOI MEMODTEI AMOUNTI BRCDSI TYPEI TRANSMONI
28004125 251942 05-SEP-92 400 513 1 0
28004125 251943 04-OCT-92 400 513 1 0
SQL> -
Generated XML doc file contains comments from MFC source code
Hello, in my project I use the option /doc to generate XML doc file from my source codes but unfortunately in the output XML file there are mixed also comments from original MFC source codes, see the part of generated xml file:
Is there a solution to ignore these MFC cpp files?
Many thanks
Regards
Petr Stejskal
<?xml version="1.0"?>
<style xmlns="http://www.w3.org/1999/xhtml">@namespace html url(http://www.w3.org/1999/xhtml); :root { font:small Verdana; font-weight: bold; padding: 2em; padding- } * { display: block; padding- } html|style { display: none; } html|span, html|a
{ display: inline; padding: 0; font-weight: normal; text-decoration: none; } html|span.block { display: block; } *[html|hidden], span.block[html|hidden] { display: none; } .expand { display: block; } .expand:before { content: '+'; color: red; } .collapse
{ display: block; } .collapse:before { content: '-'; color: red; } </style><doc><assembly><assembly>
"Console" </assembly></assembly><members><members><member name="T:_RS"><member
name="T:_RS">Reed-Solomon codec control block</member></member><member name="M:MMask_makeMask(System.Int32,System.Byte*,System.Int32,QRecLevel)"><member
name="M:MMask_makeMask(System.Int32,System.Byte*,System.Int32,QRecLevel)">Mode indicator. See Table 2 in Appendix 1 of JIS X0510:2004, pp.107.</member></member><member
name="M:CMFCControlRenderer.IsScaled"><member
name="M:CMFCControlRenderer.IsScaled"><summary><summary>Tells whether this control
renderer works with scaled (resized) images.</summary></summary><returns><returns>Returns TRUE if this control
renderer works with resized (scaled) images.</returns></returns></member></member><member name="M:CMFCControlRenderer.SmoothResize(System.Double)"><member
name="M:CMFCControlRenderer.SmoothResize(System.Double)"><summary><summary>
Smoothly resizes images.</summary></summary><param name="dblScale" /><param
name="dblScale"> Scale ratio.</param><returns><returns>
TRUE if resize succeeds; otherwise FALSE.</returns></returns></member></member><member name="M:CDrawingManager.CreateBitmap_32(HBITMAP__*,System.UInt32!System.Runtime.CompilerServices.IsLong)"><member
name="M:CDrawingManager.CreateBitmap_32(HBITMAP__*,System.UInt32!System.Runtime.CompilerServices.IsLong)"><summary><summary>
Creates a 32 bit bitmap from the specified bitmap.</summary></summary><returns><returns> A handle to created
bitmap, or NULL, if creation fails.</returns></returns><param name="bitmap" /><param
name="bitmap"> A handle to the original bitmap.</param><param name="clrTransparent"
/><param
name="clrTransparent"> An RGB value specifying transparent color of the original bitmap.</param></member></member><member
name="M:CDrawingManager.CreateBitmap_32(CSize!System.Runtime.CompilerServices.IsConst*!System.Runtime.CompilerServices.IsImplicitlyDereferenced,System.Void**)"><member
name="M:CDrawingManager.CreateBitmap_32(CSize!System.Runtime.CompilerServices.IsConst*!System.Runtime.CompilerServices.IsImplicitlyDereferenced,System.Void**)"><summary><summary>
Creates an empty 32 bit bitmap.</summary></summary><returns><returns> A handle to created bitmap, or NULL,
if creation fails.</returns></returns><param name="size" /><param
name="size">Specifies bitmap size.</param><param name="pBits" /><param
name="pBits">When the function returns contains a pointer to bitmap bits.</param></member></member><member
name="M:CDrawingManager.DrawRotated(CRect,CDC*!System.Runtime.CompilerServices.IsImplicitlyDereferenced,System.Int32)"><member
name="M:CDrawingManager.DrawRotated(CRect,CDC*!System.Runtime.CompilerServices.IsImplicitlyDereferenced,System.Int32)"><summary><summary>Rotates
a source DC content inside the given rectangle by +/- 90 degrees</summary></summary><param name="rectDest" /><param
name="rectDest">Destination rectangle</param><param name="dcSrc" /><param
name="dcSrc">The source device content.</param><param name="bClockWise"
/><param
name="bClockWise">TRUE - rotate +90 degrees, FALSE - 90.</param></member></member><member
name="M:AfxRegDeleteKey(HKEY__*,System.Char!System.Runtime.CompilerServices.IsConst*,ATL.CAtlTransactionManager*)"><member
name="M:AfxRegDeleteKey(HKEY__*,System.Char!System.Runtime.CompilerServices.IsConst*,ATL.CAtlTransactionManager*)"><summary><summary>Deletes
the specified registry key.</summary></summary><returns><returns> If the function succeeds, the return
value is ERROR_SUCCESS. If the function fails, the return value is a nonzero error code defined in Winerror.h</returns></returns><param name="hKey" /><param
name="hKey">A handle to an open registry key.</param><param name="lpSubKey"
/><param
name="lpSubKey">The name of the key to be deleted.</param><param name="pTM" /><param
name="pTM">Pointer to CAtlTransactionManager object</param></member></member><member
name="M:AfxRegOpenKeyEx(HKEY__*,System.Char!System.Runtime.CompilerServices.IsConst*,System.UInt32!System.Runtime.CompilerServices.IsLong,System.UInt32!System.Runtime.CompilerServices.IsLong,HKEY__**,ATL.CAtlTransactionManager*)"><member
name="M:AfxRegOpenKeyEx(HKEY__*,System.Char!System.Runtime.CompilerServices.IsConst*,System.UInt32!System.Runtime.CompilerServices.IsLong,System.UInt32!System.Runtime.CompilerServices.IsLong,HKEY__**,ATL.CAtlTransactionManager*)"><summary><summary>Opens
the specified registry key.</summary></summary><returns><returns> If the function succeeds, the return
value is ERROR_SUCCESS. If the function fails, the return value is a nonzero error code defined in Winerror.h</returns></returns><param name="hKey" /><param
name="hKey">A handle to an open registry key.</param><param name="lpSubKey"
/><param
name="lpSubKey">The name of a key that this function opens or creates.</param><param name="ulOptions"
/><param
name="ulOptions">This parameter is reserved and must be zero.</param><param name="samDesired" /><param
name="samDesired">A mask that specifies the desired access rights to the key.</param><param
name="phkResult" /><param
name="phkResult">A pointer to a variable that receives a handle to the openedkey.</param><param
name="pTM" /><param
name="pTM">Pointer to CAtlTransactionManager object</param></member></member></members>Hi stejsky,
Thank you for posting in MSDN forum.
>>In my project I use the option /doc to generate XML doc file from my source codes but unfortunately in the output XML file there are mixed also comments from original MFC source codes.
Based on your issue, could you please tell me how you use the option /doc to generate XML doc file from your source codes?
If you use the option /doc to generate the XML doc file by right-click the your MFC project->Properties->Configuration Properties->C/C++->Output file->set the Generate XML document files as Yes(/doc) like the following screen shot.
(1)If yes, since we could not reproduce your issue in mu side, so if possible, I suggest you could share me your MFC project so that we will further help you support this issue.
You could upload your MFC project to the OneDrive and then copy link here.
(2)If no, please try the above way to generate XML doc file and then check if you still get same issue.
Best Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Repository event handler doesn't work when inserting an xml-doc via ftp
Hi,
I want to add a 'schemaLocation'-attribute to an XML-document when I load it in the repository. Therefore, I use the precreate-repository event and created a Repository Event Handler (see code extract below).
Everything works fine if I type the following code in SQL Plus:
Declare
v_return BOOLEAN;
Begin
v_return:=DBMS_XDB.createresource('/public/xml/test.xml', XMLType(bfilename('XMLDIR', 'test.xml'),nls_charset_id('AL32UTF8')));
end;Unfortunately, when I try to insert an XML-document via ftp into the /public/xml folder it doesn´t work as expected and no 'schemaLocation'-attribute is added to the new resource.
What's the reason for this strange behavior and how can I solve it?
For your information: I use the Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Thank you very much for your help!!!
Repository Event Handler code extract:_
create or replace
PACKAGE BODY schemalocation AS
PROCEDURE handlePreCreate (eventObject DBMS_XEVENT.XDBRepositoryEvent) AS
XDBResourceObj DBMS_XDBRESOURCE.XDBResource;
var XMLType;
l_return BOOLEAN;
l_xmldoc dbms_xmldom.DOMDocument;
l_docelem dbms_xmldom.DOMElement;
l_attr dbms_xmldom.DOMAttr;
c1 clob;
node dbms_xmldom.DOMNode;
txid varchar2(100);
dDoc DBMS_XMLDOM.DOMDocument;
nlNodeList DBMS_XMLDOM.DOMNodeList;
BEGIN
XDBResourceObj := DBMS_XEVENT.getResource(eventObject);
dbms_lob.createTemporary(c1,TRUE);
var:=DBMS_XDBRESOURCE.getcontentxml(XDBResourceObj);
l_xmldoc := dbms_xmldom.newDOMDocument(var);
l_docelem := DBMS_XMLDOM.getDocumentElement(l_xmldoc);
------ add schemaLocation attribute
l_attr := DBMS_XMLDOM.createAttribute(l_xmldoc, 'xsi:schemaLocation');
DBMS_XMLDOM.setValue(l_attr, 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd');
l_attr := DBMS_XMLDOM.setAttributeNode(l_docelem, l_attr);
DBMS_XMLDOM.WRITETOCLOB(l_xmldoc, c1);
------- get the value of the TxId-tag
dDoc := DBMS_XMLDOM.NEWDOMDOCUMENT(c1);
nlNodeList := DBMS_XMLDOM.GETELEMENTSBYTAGNAME(dDoc, 'TxId');
node := DBMS_XMLDOM.ITEM(nlNodeList, 0);
txid:= dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(node));
l_return:=DBMS_XDB.createresource('/public/ok/'||txid||'.xml', XMLType(c1));
END;Marco,
Here's an example of the problem :
create or replace package handle_events
as
procedure handlePreCreate(p_event dbms_xevent.XDBRepositoryEvent);
end;
create or replace package body handle_events
is
procedure handlePreCreate (p_event dbms_xevent.XDBRepositoryEvent)
is
XDBResourceObj dbms_xdbresource.XDBResource;
doc XMLType;
res boolean;
begin
XDBResourceObj := dbms_xevent.getResource(p_event);
doc := dbms_xdbresource.getContentXML(XDBResourceObj);
select insertchildxml(
doc
, '/root'
, '@xsi:schemaLocation'
, 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd'
, 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
into doc
from dual;
res := dbms_xdb.CreateResource('/public/xml/result.xml', doc);
end;
end;
declare
res boolean;
begin
res := dbms_xdb.CreateFolder('/public');
res := dbms_xdb.CreateFolder('/public/tmp');
res := dbms_xdb.CreateFolder('/public/xml');
end;
declare
res boolean;
resconfig xmltype;
my_schema varchar2(30) := 'DEV';
resconfig_path varchar2(300) := '/public/ResConfig.xml';
resource_path varchar2(300) := '/public/tmp';
begin
resconfig := xmltype(
'<ResConfig xmlns="http://xmlns.oracle.com/xdb/XDBResConfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/xdb/XDBResConfig.xsd http://xmlns.oracle.com/xdb/XDBResConfig.xsd">
<event-listeners set-invoker="true">
<listener>
<description>My event handler</description>
<schema>'||my_schema||'</schema>
<source>HANDLE_EVENTS</source>
<language>PL/SQL</language>
<events>
<Pre-Create/>
</events>
<pre-condition>
<existsNode>
<XPath>/r:Resource[r:ContentType="text/xml"]</XPath>
<namespace>xmlns:r="http://xmlns.oracle.com/xdb/XDBResource.xsd"</namespace>
</existsNode>
</pre-condition>
</listener>
</event-listeners>
<defaultChildConfig>
<configuration>
<path>'||resconfig_path||'</path>
</configuration>
</defaultChildConfig>
</ResConfig>'
res := dbms_xdb.CreateResource(resconfig_path, resconfig);
dbms_resconfig.addResConfig(resource_path, resconfig_path, null);
end;
/Giving the following input XML file :
<?xml version="1.0" encoding="utf-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>This works :
SQL> declare
2 res boolean;
3 begin
4 res := dbms_xdb.CreateResource('/public/tmp/test.xml',
5 xmltype(bfilename('TEST_DIR','test.xml'), nls_charset_id('AL32UTF8')));
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
as clob indent size = 2) result
2 from dual
3 ;
RESULT
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd
"/>With the same document loaded via FTP, we get :
SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
as clob indent size = 2) result
2 from dual
3 ;
ERROR:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00283: document encoding is UTF-16-based but default input encoding is not
Error at line 1
no rows selectedand the content looks like :
< ? x m l v e r s i o n = " 1 . 0 " e n c o d i n g = " u t f - 8 " ? >
< r o o t x m l n s : x s i = " h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a - i n s t a n c e " / >As a workaround, I've found that serializing and re-parsing the document solves the problem :
select insertchildxml(
xmltype(doc.getclobval())
, '/root'
, '@xsi:schemaLocation'
, 'urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd'
, 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
into doc
from dual;
...We then get the expected result after FTP transfer :
SQL> select XMLSerialize(document xdburitype('/public/xml/result.xml').getXML()
as clob indent size = 2) result
2 from dual
3 ;
RESULT
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
urn:iso:std:iso:20022:tech:xsd:sese.023.001.01 http://www.test.com/Testswift.xsd
"/>The workaround also works for the DOM version presented above.
Any ideas? -
Java stored proc performance parsing XML docs
Hi
We are using ORACLE 8i(8.1.6). I have a JAVA Stored procedure that parses XML doc and returns tha values. If I am testing on the box, I get an avg. return time of 2 secs. If I have 20 users, my return time for all went to 25 to 35 secs?
Are there any parameters on ORACLE I can modify to increase the performance. We are developing app for 1000 to 1500 users. I dont want to guess the time based on my test with 20 users.
Any help will be greatly appreciated.
Thank You
RajuRaju,
Oracle 8.1.7 should be better choice for you since it does have the XML stuff
natively compiled.
Regarding scaleability the JVM should scale
very well. However let us know what you find.
- Stefan -
Problem inserting XML doc (character set)
Hi all,
I'm having trouble trying to insert XML either "posting" it (xsql) or "putting" it
(OracleXML putXML).
The error that I get: "not supported
oracle-character-set-174".
The environment is:
Oracle 8i 8.1.5
(NLS_CHARACTERSET EL8MSWIN1253 for greek)
JDK 1.2.2
Apache Web Server 1.3.11
Apache JServ 1.1
XSQL v 0.9.9.1 and
XMLSQL, XML parser v2 that comes with it.
I had dropped all java classes and reloaded
them using oraclexmlsqlload batch file.
But still getting the same error.
The thing that is that I am
able to insert XML doc that was generated
with an authoring tool called W4F that extracts data from HTML pages and map them to
XML document, even with greek characters
in it. But when XML is generated using
an editor or the servlet like the following:
newschedule.xsql like
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="latestschedules.xsl"?>
<page connection="dtv" xmlns:xsql="urn:oracle-xsql">
<xsql:insert-request date-format="DD'/'MM'/'YYYY" table="schedule_details_view"
transform="request-to-newschedule.xsl"/>
<xsql:query table="schedule"
tag-case="lower" max-rows="5" rowset-element="latestschedules"
row-element="schedule">
select *
from schedules
order by schedule_id desc
</xsql:query>
</page>
request-to-newschedule.xsl like
<?xml version = '1.0'?>
<ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
<xsl:for-each select="request/parameters">
<ROW>
<SCHEDULE_ID><xsl:value-of select="Schedule_id_field"/></SCHEDULE_ID>
<DESCRIPTION><xsl:value-of select="Description_field"/></DESCRIPTION>
<DETAILS>
<DETAILS_ITEM>
<STARTING_TIME><xsl:value-of select="Starting_Time_field_1"/></STARTING_TIME>
<DURATION><xsl:value-of select="Duration_field_1"/></DURATION>
</DETAILS_ITEM>
<DETAILS_ITEM>
<STARTING_TIME><xsl:value-of select="Starting_Time_field_2"/></STARTING_TIME>
<DURATION><xsl:value-of select="Duration_field_2"/></DURATION>
</DETAILS_ITEM>
<DETAILS_ITEM>
<STARTING_TIME><xsl:value-of select="Starting_Time_field_3"/></STARTING_TIME>
<DURATION><xsl:value-of select="Duration_field_3"/></DURATION>
</DETAILS_ITEM>
<DETAILS_ITEM>
<STARTING_TIME><xsl:value-of select="Starting_Time_field_4"/></STARTING_TIME>
<DURATION><xsl:value-of select="Duration_field_4"/></DURATION>
</DETAILS_ITEM>
<DETAILS_ITEM>
<STARTING_TIME><xsl:value-of select="Starting_Time_field_5"/></STARTING_TIME>
<DURATION><xsl:value-of select="Duration_field_5"/></DURATION>
</DETAILS_ITEM>
</DETAILS>
</ROW>
</xsl:for-each>
</ROWSET>
Hope that someone could help me on this ...
Any advice is highly appreciated.
Thanks in advance
Nicos Gabrielides
email: [email protected]Hi,
How about applying an XSL on the existing XML doc to create another XML doc to filter out the table column not found in the target db table, so that all the columns are matched and then use putXML to load?
Hope that helps.
OTN team@IDC -
Validating xml doc using schema
I was wondering if you can the following validation of an xml document using schema:
<parent>
<child>Jogn</child>
<child>Hanna</child>
<child>Blake</child>
<childCount>3</childCount>
<parent>the childcountValue equals the number of child node. is this possible using
schema or do do i have to use an application to do this?
thanx in advancethanx dvohra, but i already know how to validate schema using a parser.
I'm looking for a way in the schema that specified thhat the total number of child elemnt equals to the integer value of the childTotal element. I don't even know if this is possible. If possible, what (tag) would i use. i don't need answer..hint would be nice.
my other solution is to write an application that use a SAX parser to parse the xml doc. Although this is relatively easy, i would like to keep the validation within on file (the schema)..rather than have it be in the schema and a ContentHandler. -
How to show an XML doc's node?/element in a dynamic textbox?
Hello!
I would like to show an XML doc's node?/element in a textbox. I am importing the XML data from a PHP page. My code looks like this:
var xmlRequest:URLRequest = new URLRequest("adatatvitel.php");
var xmlLoader:URLLoader = new URLLoader(xmlRequest);
xmlLoader.addEventListener(Event.COMPLETE, init);
function init(e:Event):void{
var xmlDoc:XMLDocument = new XMLDocument();
xmlDoc.ignoreWhite = true;
var datasXML:XML = XML(xmlLoader.data);
xmlDoc.parseXML(datasXML.toXMLString());
This program would be a quiz. First I would like to write out the first data: Question with the appropriate Answers. If the player's answer is correct, the program would show the second set. Thanks in advance!
Here is my PHP code:
<?php
require("db.php");
$sql = "SELECT * FROM kerdesvalasz";
$result = mysql_query($sql) or die(mysql_error());
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<datas>";
while($row = mysql_fetch_array($result))
echo '<data>';
echo '<question>'.$row['kerdes'].'</question>';
echo '<answer1>'.$row['valasz1'].'</answer1>';
echo '<answer2>'.$row['valasz2'].'</answer2>';
echo '<answer3>'.$row['valasz3'].'</answer3>';
echo '<answer4>'.$row['valasz4'].'</answer4>';
echo '<correct>'.$row['helyes'].'</correct>';
echo '</data>';
echo "</datas>";
?>Hi Taly,
Florian is right, you need to knwo / set a maximum columns ( i assumed he actually mean column) so that content being displayed will be visible on form.
I would suggest you to reaccess to your solution again if this design and think what if you have 999 columns, how do you want to display the content in form .
I would suggest to transpose your content to display as row in form, and let the content to flow.
This should solve your issue.
Hope this helps.
regards,
Xiang Li -
Attaching two XML docs together using XPath
Hi,
I have a conceptual question about whether something can be done in Oracle XML DB.
I have two XML docs, doc1 and doc2. I want to attach doc2 to doc1 at some particular subelement of doc1's root element. I know the path to this subelement because I have an XPath which uniquely identifies that subelement. Assuming that these two docs are XMLTYPEs, is there a way to do this using XML DB functions, given only the XPath? Also, keep in mind that I don't know the structure of the documents at development time
To better explain my question here is a stupid-simple example:
doc1:
<company>
<department name="Sales"/>
<department name="Marketing"/>
</company>
doc2:
<employees>
<employee name="Fred"/>
<employee name="Jim"/>
</employees>
I want to attach doc2 into doc1 under doc1's <department name="Sales"/> element.
I know that the XPath to this element is "/company/department[@name='Sales']"
Is there any kind of Oracle magic that, given only doc1, doc2 and this XPath, would give me doc3:
<company>
<department name="Sales">
<employees>
<employee name="Fred"/>
<employee name="Jim"/>
</employees>
</department>
<department name="Marketing"/>
</company>
Although it seems kind of silly, whether or not this is possible will have to determine whether I use Oracle XML DB for my application. Also, in some situations the subelement I am attaching under may be nested 3, 4 or more elements below the root.
Thanks in advance for any help,
-BradYep ... exactly what I'm trying to do ... but it still don't work. This is what I get when I paste that into my SQL*Plus interface:
SQL> set long 100000
SQL> select updateXML(
2 xmltype('
3 <Document>
4 <DocInfo>
5 <EntityRef>EntityName</EntityRef>
6 </DocInfo>
7 <Body>
8 <EntityRef>Entity2</EntityRef>
9 </Body>
10 </Document>'),
11 '//EntityRef[text()="Entity2"]',
12 XMLType('<NewRef>Something New</NewRef>')) from dual;
UPDATEXML(XMLTYPE('<DOCUMENT><DOCINFO><ENTITYREF>ENTITYNAME</ENTITYREF></DOCINFO
<Document>
<DocInfo>
<EntityRef>EntityName</EntityRef>
</DocInfo>
<Body>
<EntityRef>Entity2</EntityRef>
</Body>
</Document>
Is there a version of something or a pointer or a wrong package or something that I should be looking for? It's acting almost as though the functionality is stubbed out or not casting right or something.
Here's an even odder deal:
SQL> set long 100000
SQL> select updateXML(
2 xmltype('
3 <Document>
4 <DocInfo>
5 <EntityRef>EntityName</EntityRef>
6 </DocInfo>
7 <Body>
8 <EntityRef>Entity2</EntityRef>
9 </Body>
10 </D[i]Long postings are being truncated to ~1 kB at this time. -
Has anybody tried creating and validating a XML doc with XML Schema?
Hi,
Has anybody tried creating and validating a XML doc with XML Schema?With XMLBeans, an XML document may be created from and validated with an XML schema.
-
Add a prefix to sign an XML file
Hello,
I use an X509 certificate to sign an XML file but the prefix related to the signature is missing, I have to add the "ds" one.
How to add this prefix without having to break my signature?
I used this site to get some help but the checking signature fails by adding the "ds" prefix : http://msdn.microsoft.com/en-gb/library/ms148731%28v=vs.110%29.aspx
ThanksHello,
I use an X509 certificate to sign an XML file but the prefix related to the signature is missing, I have to add the "ds" one.
How to add this prefix without having to break my signature?
I used this site to get some help but the checking signature fails by adding the "ds" prefix : http://msdn.microsoft.com/en-gb/library/ms148731%28v=vs.110%29.aspx
Thanks
Seems that is the same case with
http://stackoverflow.com/questions/381517/net-signed-xml-prefix
which shows that is not suggested.
remember make the reply as answer and vote the reply as helpful if it helps. -
Problems while writing xml doc to a file
Hi all , in my project (of distributed xml databases) i need to write the xml files from the main server to the clients.
These xml files i had formed by fragmenting one xml doc and i did the fragmentation using ....
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.transform(new DOMSource(root),
new StreamResult(new FileOutputStream(outputFile)));
Now the problem is that on the client where these fragments reside..i m not able to do the indexing of the document properly ie...
some extra text nodes with no values are coming in the index...
i dont know how to deal wid the extra nodes that i m getting after parsing the file and craeting an index for the same..
may be its coz of the transformer func i m using....don know(???)
Note : i m fragmenting the xml files into text files using the above function and then sending thm to the client via sockets.
Also,after fragmenting i am getting sumthng like
<?xml version="1.0" encoding="UTF-8"?>
in all the files..is this a source of any problem....
plz reply soon....You have not described how you "index" the files and what you mean by that.
Are you processing them with SAX or DOM, or one of the variations of those means?
Is there a chance that the "extra" nodes are simply text nodes with newlines ("\n")? There are usually a lot of extra text nodes in a file each containing only one newline.
If you are using SAX, there is no requirement for the parser to collect all of the text inside an element into a single block before calling the characters method. You may get several calls to characters between the start of an element and the end. If you change parsers, you may even get a different number of calls, but the character data will always be the same.
Dave Patterson
As to the <?xml version="1.0" encoding="UTF-8"?> line, that is perfectly fine. It means that your file thinks it is valid XML. Whether or not it REALLY is valid depends on a validation of the file. -
Need help on processing XML doc using Java store procedure
I am currently working on project to read, parse XML document and store data in XML document into database columns. I use JAVA API-OracleXMLSave in my java store procedure to do it, which use URL of XML doc to read, parse doc and store the data to database columns. My java store procedure works fine when XML doc is saved in server, but got "ORA-29532: Java call terminated by uncaught Java exception:
oracle.xml.sql.OracleXMLSQLException: No such file or directory" if XML doc is in client's PC instead of in server. I think the problem comes from the URL that created using OracleXMLSave
--createURL(fileName) based on the filename. what will be the filename if XML document located in Client PC like C:\myprojects\xmldoc.xml?
Thank you in advance if anyone can give some hints.I am currently working on project to read, parse XML document and store data in XML document into database columns. I use JAVA API-OracleXMLSave in my java store procedure to do it, which use URL of XML doc to read, parse doc and store the data to database columns. My java store procedure works fine when XML doc is saved in server, but got "ORA-29532: Java call terminated by uncaught Java exception:
oracle.xml.sql.OracleXMLSQLException: No such file or directory" if XML doc is in client's PC instead of in server. I think the problem comes from the URL that created using OracleXMLSave
--createURL(fileName) based on the filename. what will be the filename if XML document located in Client PC like C:\myprojects\xmldoc.xml?
Thank you in advance if anyone can give some hints. -
Converting XML doc to TreeNode object
Hi,
I am trying to build a Tree in Workshop 8.1 using netui:tree tag (for data in
an XML file).
The BEA docs say that we have to assign the TreeNode object to the 'tree' attribute
in the netui:tree tag.
What is the best way to translate the XML doc into a TreeNode object(s)?
Thanks, AjayHTML to PDF with Java, using OpenOffice.org - example here: [http://www.dancrintea.ro/html-to-pdf/|http://www.dancrintea.ro/html-to-pdf/]
You can use OpenOffice.org, running as a server and command it remotely for document convertion.
Besides HTML to PDF, there are also possible other convertions:
doc --> pdf, html, txt, rtf
xls --> pdf, html, csv
ppt --> pdf, swf
Code example:
import officetools.OfficeFile; // this is my tools package
FileInputStream fis = new FileInputStream(new File("c:/test.html"));
FileOutputStream fos = new FileOutputStream(new File("c:/test.pdf"));
// suppose OpenOffice.org runs on localhost, port 8100
OfficeFile f = new OfficeFile(fis,"localhost","8100", true);
f.convert(fos,"pdf");
-----------------------------------------------------------------------------------------------------------------------------------------
Maybe you are looking for
-
Anything known on this issue? Solutions? Even importing files from memory card is a problem. In import window images are not diplayed as images but all the same blue mini images. vertical files are changed into landscape positions and more. Mac versi
-
ORACLE EXPRESS: build a page with multiple forms linked to one table
hi, im using oravle application express. APEX i would like to build a page with multiple forms linked to one table (orders) , the page has 4 from each one with different order_id number (depending on filtering), and if the order is prepared click y
-
Total Amount Spend (ekbe-dmbtr) on Material & Vendor
Hi, In My first ITAB, I have a list of Material & It's related Vendor Like, Material Vendor MM1 ABC MM2 ABC MM2 XYZ MM3 MNO In my next ITAB I need to find Total Amount Spend for this Material on It's V
-
Hi All, I need a script that pulls only reconciled GL Accounts. Using the GL reconciliation menu, you can reconcile GL accounts for unreconciled items. But I need to see just the reconcilied items from same window. Regards
-
last I bought this case from the Apple store, this the thing make by apple. Is there any solution for this problem?