Xml file without namespace with file adapter
Hi,
Please can you assist. We will be receiving a XML file from an application without the namespace in the file.
As I tested thusfar PI requires a namespace as part of the xml file.
How would it be possible to you handle this with the file adapter.
Ex.
<?xml version="1.0" encoding="UTF-8"?>
<applicatrion>
<orders>
<order>
<action>I</action>
<orderId>4261A92485</orderId>
</order>
</orders>
</application>
Regards
Willie Hugo
Hi Hugo,
Please see if this link could clear some doubts http://www.w3schools.com/XML/xml_namespaces.asp
We generally get an idoc xml in the below format without any issues:
<?xml version="1.0" encoding="UTF-8" ?>
- <ORDERS05>
- <IDOC BEGIN="1">
- <EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<MANDT>510</MANDT>
<DOCNUM>0000000000127051</DOCNUM>
<DOCREL>700</DOCREL>
<DIRECT>1</DIRECT>
<IDOCTYP>ORDERS05</IDOCTYP>
</EDI_DC40>
Thanks,
Sudhansu
Similar Messages
-
Special characters issue in output XML - file adapter - SOA 10.1.3.4
Hi,
I use a DB adapter and File adapter to retreive data from database and create output XML file.
For the database record which have special characters (for example ' , <, >), it will just output the same character in XML file, which cause other system to reject this XML file because of those characters.
Anyone have this issue ? How can i resolve that ?
ThanksTry converting the characters to < and >. This should work. Make sure the stand-alone & character is converted to & amp; (written with space as HTML will convert it back to &).
-AR -
Plain HTTP Adapter (XML return without namespace)
Hello Experts,
I'm very new at XI.
I'm using XI 7.0 SP9.
I wanna make interface with public website using plain HTTP adapter.
The receiver url is
http://openapi.naver.com/search?key=cdb64b1f218b55acbb73105b3b6f68a9&query=news&target=rank
It returns XML like
<?xml version="1.0" encoding="UTF-8" ?>
<result>
<item>
<R1>
<K>CHOICE</K>
<S>new</S>
<V>0</V>
</R1>
</item>
</result>
How I can specify namespace and root document type ?
I learned that I can specify namespace and root document type in JDBC communication channel.
In plain HTTP, Is there any possibility to specify namespace like JDBC?Ji,
look at this it will help u.
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
/people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
/people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
Sreeram Reddy -
For now I have:
<?xml version="1.0" encoding="UTF-8"?>
<EPERSON filename="20081010142234">
<CONTEXTPERSON>
</CONTEXTPERSON>
<CONTEXTPERSON>
</CONTEXTPERSON>
</EPERSON>
and I need (requisite for the external system):
<?xml version="1.0" encoding="UTF-8"?>
<EPERSON filename="20081010142234" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
<CONTEXTPERSON>
</CONTEXTPERSON>
<CONTEXTPERSON>
</CONTEXTPERSON>
</EPERSON>
This has been done using a ExternalDefinition and importing the XSD the external application provides.
Previously I reached to have:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:EPERSON filename="20081010142234" xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance">
<CONTEXTPERSON>
</CONTEXTPERSON>
<CONTEXTPERSON>
</CONTEXTPERSON>
</ns0:EPERSON>
Any suggestions ? Hard coding the "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage"" in the mapping would also be ok for me if you have any advise in that direction.
cheers,
gregAs I know already which fields in the IDOC I need for every field in my target, maybe it would be easier to do it by hand, here is an example of target file:
<?xml version="1.0" encoding="iso-8859-1" ?>
<EPERSON filename="contextperson_000002.xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
<CONTEXTPERSON>
<PERSON action="update">
<TITLE>M</TITLE>
<FIRSTNAME>John</FIRSTNAME>
<NAME>Smith</NAME>
<BIRTHDATE>06.02.1973</BIRTHDATE>
<ADDRESS1>rue du stade</ADDRESS1>
<ADDRESS2>c/o Jean-pierre</ADDRESS2>
<POSTALCODE>CH-1234</POSTALCODE>
<CITY>Geneve</CITY>
<COUNTRYID>CH</COUNTRYID>
<CATEGORY>Standard</CATEGORY>
<CREATIONDATE>01.01.2000 09:00:00</CREATIONDATE>
</PERSON>
<MISCFIELD>
<MISCFIELDTYPE>PERSN</MISCFIELDTYPE>
<MISCFIELDVALUE>01000123</MISCFIELDVALUE>
</MISCFIELD>
<CONTACT>
<CONTACTTYPE>E-mail</CONTACTTYPE>
<CONTACTVALUE>john.smith_AT_example.com</CONTACTVALUE>
</CONTACT>
</CONTEXTPERSON>
</EPERSON>
I have to create a CONTEXTPERSON for every E1PLOGI that is in the HRMD_A07 IDOC.
Any tip for starting ? like how to get the HRMD_A07->E1PLOGI->E1PITYP->E1P0002-NACHN for the Name field ? The rest would be most like that one -
Store XML-fragment without Namespace Information
Hello,
I register a schema, create a table with a XMLTYPE column, insert a row and create a view to query the data.
ALTER SESSION SET nls_numeric_characters = '.,';
BEGIN
dbms_xmlschema.registerSchema(
'http://test_datetime.xsd'
,q'[<?xml version="1.0" encoding="WE8ISO8859P1" standalone="no"?>
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99" elementFormDefault="qualified">
<xs:element name="Document" type="Document"/>
<xs:complexType name="Document">
<xs:sequence>
<xs:element name="CreDtTm" type="ISODateTime"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ISODateTime" xdb:SQLType="TIMESTAMP WITH TIME ZONE">
<xs:restriction base="xs:dateTime"/>
</xs:simpleType>
</xs:schema>]'
,TRUE
,FALSE
,FALSE
END;
CREATE TABLE test_datetime (
id NUMBER
,xml_document XMLTYPE
XMLTYPE COLUMN xml_document
ELEMENT "pain.001.002.99.xsd#Document";
INSERT INTO test_datetime (id,xml_document)
VALUES (
1
,XMLTYPE(
q'[<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99
pain.001.002.99.xsd">
<CreDtTm>2012-06-02T09:30:47.000Z</CreDtTm>
</Document>]')
COMMIT;
CREATE OR REPLACE VIEW v_dateTime_xml AS
SELECT created.CreationDateTime
,created.CreDtTm
FROM test_datetime,
XMLTABLE(XMLNAMESPACES(DEFAULT 'urn:iso:std:iso:20022:tech:xsd:pain.001.002.99'),
'/Document'
PASSING test_datetime.xml_document
COLUMNS
CreationDateTime TIMESTAMP WITH TIME ZONE PATH 'CreDtTm'
,CreDtTm XMLTYPE PATH 'CreDtTm'
) created;I want to store the element CreDtTm in another table to use it later without recreating it (in my real code it is not a simple element, but a fragment with many elements).
Yet the selected element contains the schema information
<CreDtTm xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99">2012-06-02T09:30:47.000000+00:00</CreDtTm>Therefore, when I later use it in another XML document it is includes together with the xmlns attribute.
SELECT XMLELEMENT(
"Document"
,XMLAttributes(
'urn:iso:std:iso:20022:tech:xsd:pain.001.002.99' AS "xmlns"
,'http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi"
,'urn:iso:std:iso:20022:tech:xsd:pain.001.002.99 pain.001.002.99.xsd' AS "xsi:schemaLocation"
,( SELECT XMLAGG(CreDtTm)
FROM v_dateTime_xml
FROM dual;
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99 pain.001.002.99.xsd">
<CreDtTm xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99">2012-06-02T09:30:47.000000+00:00</CreDtTm>
</Document>How can I store or retrieve it without the schema information?
Regards
Marcus
Edited by: Marwim on 08.08.2012 14:06
Corrected schemaP.S.: Perhaps something dirty likeSure, you can always do that :)
Here are two examples with XQuery or XSLT :
SQL> var xsldoc varchar2(4000)
SQL>
SQL> begin
2
3 :xsldoc := '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4 <xsl:output method="xml" omit-xml-declaration="yes"/>
5 <xsl:template match="*">
6 <xsl:element name="{local-name()}">
7 <xsl:apply-templates select="@*|*|text()"/>
8 </xsl:element>
9 </xsl:template>
10 <xsl:template match="@*|text()">
11 <xsl:copy/>
12 </xsl:template>
13 </xsl:stylesheet>';
14
15 end;
16 /
PL/SQL procedure successfully completed
SQL>
SQL> SELECT XMLQuery(
2 'declare function local:strip-ns($e as element()) as element()
3 {
4 element {local-name($e)}
5 {
6 for $i in $e/(@*|node())
7 return typeswitch ($i)
8 case element() return local:strip-ns($i)
9 default return $i
10 }
11 }; local:strip-ns(*)'
12 passing x.CreDtTm
13 returning content
14 ) as "XQuery method"
15 , XMLTransform(x.CreDtTm, :xsldoc) as "XSLT method"
16 FROM test_datetime
17 , XMLTable(
18 XMLNamespaces(default 'urn:iso:std:iso:20022:tech:xsd:pain.001.002.99')
19 , '/Document'
20 PASSING test_datetime.xml_document
21 COLUMNS CreDtTm XMLTYPE PATH 'CreDtTm'
22 ) x
23 ;
XQuery method XSLT method
<CreDtTm> 2012-06-02T09:30:47,000000+00:00</CreDtTm> <CreDtTm> 2012-06-02T09:30:47,000000+00:00</CreDtTm> -
JMS Adapter getting xml without namespace
Hello,
We're using BPEL 10.1.3.4 and we need to integrate a legacy system with a new one. The legacy system writes in a JMS queue a simple xml message without namespaces (following although a specific schema). When in BPEL I try to get this xml I cannot access its elements and I'm getting errors like the following:
variable/ expression is empty
Which seems normal as bpel tries to access the element using namespaces.
I found this thread which seems to be the same issue Re: writing XML without namespace? but I cannot actually understand the approach.
Any help will be really usefull!
Thank you!Hi,
Did the solution mentioned in the other thread worked for you? I am having the exact problem.
Thanks. -
Writing XML without namespace?
Hi,
I have a "strange" xml schema in a system I need to export data to. It lacks any forms of namespace (possibly a converted DTD) and it seemd the FTP adapter (from BPEL) cant handle XML-types without namespaces.
Is there a way to do this without using an opaque adapter and writing the data as "text"?
The schema the file uses can be found here: http://services.agresso.com/schema/ABWSupplierCustomer/2004/07/02/ABWSupplierCustomer542.xsd
// Michael MedinThis works for both BPEL & ESB:
1. Build an XSD for the source system adapter/process with no XSD.
2. Build another XSD which acts like wrapper of original XSD.
3. In the Wrapper XSD include the actual xsd.This one is sample xsd which has the piece of code
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.org" targetNamespace="http://xmlns.oracle.com/BPELProcess2"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" nxsd:version="DTD"
elementFormDefault="qualified">
<include schemaLocation="actual.xsd"/>
</xsd:schema>The Target Namespace can be of any URL and this could be of anything.While polling the file or any JMS queue the adapter should include the wrapper xsd instead of actual xsd.This would read the file or any queue even if there is no namespace and the values can be transformed or assigned inside the process.
Peace,
G. -
File Adapter does not process the same file twice
SOA: 11.1.1.4 (non-HA).
I have a file adapter that triggers when a new file gets to a directory; the file is not deleted after the process triggers.
The process is supposed to call other services via a mediator and if any remote fault happens it should rollback automatically and re-trigger with the same file at the next polling interval.
I have literally 3 scenarios:
1). The file gets picked up once, the process fails and the file is never picked up again.
Msg in log: The file : /xx/xx/xx/abc.xml is being ignored as it has already been processed
2). If the mediator only routes to one service after the file gets picked up, it works as expect (that is rollback and restart at the next polling interval). If it has more than one sequential routing rule, I see the same error as above.
3). File does not get picked up EVEN if I "touch" or rename the file.
Msg in Log:
File Adapter ProcessName Poller enqueuing file for processing :/xx/xx/xx/abc.xml
File Adapter ProcessName Ignoring File : abc.xml as it is already enqued for processing.
I have already checked, there is no permission issue.
This is what my .jca file looks like:
<adapter-config name="getFile" adapter="File Adapter" wsdlLocation="getFile.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
<connection-factory location="eis/FileAdapter" UIincludeWildcard="*"/>
<endpoint-activation portType="Read_ptt" operation="Read">
<activation-spec className="oracle.tip.adapter.file.inbound.ScalableFileActivationSpec">
<property name="DeleteFile" value="false"/>
<property name="MinimumAge" value="5"/>
<property name="SingleThreadModel" value="true"/>
<property name="PhysicalDirectory" value="/xx/xx"/>
<property name="Recursive" value="false"/>
<property name="PollingFrequency" value="20"/>
<property name="IncludeFiles" value=".*"/>
<property name="UseHeaders" value="true"/>
<property name="MaxRaiseSize" value="5"/>
<property name="ListSorter" value="oracle.tip.adapter.file.inbound.listing.TimestampSorterAscending"/>
</activation-spec>
</endpoint-activation>
</adapter-config>
Thanks for looking into it in advance.
Any help with the error messages will be appreciated.You have to use MOVE operation, if there is any remote exception occured, then move the file to someother folder and again move back to the same folder where the file pickup will start.
In that way you will be use the same file picked up next time when the polling happens.
It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
Thanks,
Vijay -
Read XML data without name spaces from PL/SQL
Hi,
I am trying to upload XML data without namespaces into Oracle tables from PL/SQL. Below is the sample XML data.
Please let me know,How this is achievable in PL/SQL?
<?xml version="1.0" ?>
<insplist ver="2" count="1">
<insp id="219991" timestamp="134817078" stat="G" operator_id="999999" >
<data name="TIME CLOCK - PUNCH" val="INNER" type="STRING" />
</insp>
</insplist>
ThanksAnd it's even simpler with the GET method as we just have to pass the url :
SQL> DECLARE
2
3 v_url varchar2(200) := 'http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=';
4 v_address varchar2(200) := '1 rue Victor Hugo Paris France';
5
6 v_req utl_http.req;
7 v_rsp utl_http.resp;
8
9
10
11 v_xml varchar2(32767);
12
13 v_lng number;
14 v_lat number;
15
16 BEGIN
17
18 v_req := utl_http.begin_request(v_url || utl_url.escape(v_address), 'GET', utl_http.HTTP_VERSION_1_1);
19 v_rsp := utl_http.get_response(v_req);
20
21 utl_http.read_text(v_rsp, v_xml);
22 utl_http.end_response(v_rsp);
23
24 select longitude, latitude
25 into v_lng, v_lat
26 from xmltable(
27 '/GeocodeResponse/result/geometry/location'
28 passing xmlparse(document v_xml)
29 columns longitude number path 'lng'
30 , latitude number path 'lat'
31 )
32 ;
33
34 dbms_output.put_line('Longitude = ' || v_lng);
35 dbms_output.put_line('Latitude = ' || v_lat);
36
37 END;
38 /
Longitude = 2.2734472
Latitude = 48.8282741
PL/SQL procedure successfully completed
Or, taking shorcuts :
SQL> select *
2 from xmltable(
3 '/GeocodeResponse/result/geometry/location'
4 passing httpuritype('http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address='
5 || utl_url.escape('1 rue Victor Hugo Paris France')
6 ).getxml()
7 columns longitude number path 'lng'
8 , latitude number path 'lat'
9 )
10 ;
LONGITUDE LATITUDE
2,2734472 48,8282741 -
File Adapte picking up XML if XSD valid without verifing the XSD in adapter
hi',
I am facing one issue
I have a sample XML file which I want to read through BPEL process
for this I have configured the file adapter with the schema and reading the file adapter with the receive activity
next I have created one XSD file (which file adapter referes to) and one XML file,
File adapter reads it after the XML file gets validated with the XSD which is kept in a location *'/test/xsd/emp.xsd'*,
now the issue is that the file adapter is picking up and initiating the process without verifying the XSD mentioned in the adapter
it is only checking the XML file with the XSD mentioned in the XML,
for example if I have a xml file which is refering to some other schema it also gets read by file adapter without worring about what schema is mentioned in file adapter
please advice me is this the way File adapter works in Oracle BPEL or I am doing some thing wrong
I am using SOA suite 10.1.3.3.0 which is deployed in UNIX enviornment.
thanks
Yatanthanks Ketan ,
as you suggested, after adding validateXML to true, the XML is getting validated to the XSD in the adapter,
the process is getting invoked and the receive activity is throwing error of 'Invalid XML', this is perfect as I expected
however now the issue is, the file which is invalid in terms of XSD present in the file adapter is still being archived to 'success dir' i.e. 'LogicalArchiveDirectory', ideally it should have moved to fail directory,
but if the XML file is not complete or having some error in terms of the XSD it is refering to 'target namespace' and 'target location'
then it will move to the fail directory and the receive activity is also showing the error,
see this is how I have configured my bpel.xml file for the file adapter.
<activationAgents>
<activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent" partnerLink="Read_Tph_ProdTrans_File">
<property name=*"prod_trans_success_file" type="LogicalArchiveDirectory"*>/aaa/bb/ccc/wis/tph/bpl_inbound/adjust/success</property>
<property name=*"prod_trans_incoming_file" type="LogicalDirectory"*>/aaa/bb/ccc/wis/tph/bpl_inbound/adjust/new</property>
<property name="portType">Read_ptt</property>
<property name="rejectedMessageHandlers">file:///aaa/bb/ccc/wis/tph/bpl_inbound/adjust/fail</property>
</activationAgent>
please advice how to bring this adapter to proper behaviour.
thanks
Yatan -
Duplicate namespace declarations when writing a file with JCA file adapter
I am using JCA File adapter to write a an XML file. The composite contains a mediator which received and transforms an XML to desired format and then calls a JCA file adapter to write the file.
The problem that I am having is that the written file has declaration of namespaces repeated with repeating elements instead of a single declaration at root. For ex.
instead of
<ns0:Root xmlns:ns0="namespace0" xmlns:ns1="namespace1" xmlns:ns2="namespace2">
<ns0:RepeatingChild>
<ns1:Element1>value1</ns1:Element1>
<ns2:Element2>value2</ns2:Element2>
</ns0:RepeatingChild>
<ns0:RepeatingChild>
<ns1:Element1>value3</ns1:Element1>
<ns2:Element2>value4</ns2:Element2>
</ns0:RepeatingChild>
</ns0:Root>What I see in the file is:
<ns0:Root xmlns:ns0="namespace0" xmlns:ns1="namespace1" xmlns:ns2="namespace2">
<ns0:RepeatingChild>
<ns1:Element1 xmlns:ns1="namespace1" xmlns:"namespace1">value1</ns1:Element1>
<ns2:Element2 xmlns:ns2="namespace2" xmlns:"namespace2">>value2</ns2:Element2>
</ns0:RepeatingChild>
<ns0:RepeatingChild>
<ns1:Element1 xmlns:ns1="namespace1" xmlns:"namespace1">>value3</ns1:Element1>
<ns2:Element2 xmlns:ns2="namespace2" xmlns:"namespace2">>value4</ns2:Element2>
</ns0:RepeatingChild>
</ns0:Root>So basically all the elements which are in different namespace than root element have a namespace declaration repeated even though the namespace identifier is declared at the root elment level.
Although, the XML is still valid, but this is unnecessarily increasing the filesizes 3-4 times. Is there a way I can write the XML file without duplicate declarations of namespaces?
I am using SOA Suite 11.1.1.4
The file adapter has the schema set as above XML.
I tried the transformation in mediator using XSL and also tried using assign [source(input to mediator) and target(output of mediator, input of file adapter) XMLs are exactly same].
but no success.I used automapper of JDeveloper to generate the schema. The source and target schema are exactly same.
I was trying to figure it out and I observed that if the namespaces in question are listed in exclude-result-prefixes list in xsl, then while testing the XSL in jDeveloper duplicate namespaces occur in the target and if I remove the namespace identifiers from the exclude-result-prefixes list then in jDeveloper testing the target correctly has only a single namespace declaration at the root node.
But, when I deployed the same to server and tested there, again the same problem. -
Need help with reading XML using File Adapter
I have created a simple BPEL process that uses a file adapter to read files containing XML messages of a simple xsd schema. But when reading the xml, I get the following error message:
[2010/03/01 23:43:13] Invalid data: The value for variable "Receive_1_Read_InputVariable", part "revision-report" does not match the schema definition for this part.The invalid xml document is shown below: More...
[2010/03/01 23:43:13] "{http://schemas.oracle.com/bpel/extension}invalidVariables" has been thrown. less
-<invalidVariables xmlns="http://schemas.oracle.com/bpel/extension">
-<part name="code">
<code>
9710
</code>
</part>
-<part name="summary">
<summary>
Invalid xml document.
According to the xml schemas, the xml document is invalid. The reason is: Error::cvc-complex-type.4: Attribute 'doc' must appear on element 'revision-report'.
Error::cvc-complex-type.4: Attribute 'model' must appear on element 'revision-report'.
Error::cvc-complex-type.4: Attribute 'pubdate' must appear on element 'revision-report'.
Error::cvc-complex-type.2.4.b: The content of element 'revision-report' is not complete. One of '{"http://xmlns.oracle.com/xmlfile":alternategroup}' is expected.
Please make sure that the xml document is valid against your schemas.
</summary>
</part>
</invalidVariables>
It seems that there is some issue with the namespace, but even after trying out various combinations, I am not able to resolve this.
Here the message schema (xsd):
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/xmlfile"
xmlns:tns="http://xmlns.oracle.com/xmlfile"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="revision-report">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="alternategroup">
<xs:complexType>
<xs:attribute name="name" use="required" type="xs:string"/>
<xs:attribute name="Desc" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="doc" use="required" type="xs:string"/>
<xs:attribute name="model" use="required" type="xs:string"/>
<xs:attribute name="pubdate" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>
And here is the xml file to be read by the file adapter:
<?xml version="1.0" encoding="UTF-8" ?>
<revision-report doc="doc2" model="model4" pubdate="pubdate5">
<alternategroup Name="ABC" Desc="ABC-Desc">
</alternategroup>
<alternategroup Name="DEF" Desc="DEF-Desc">
</alternategroup>
<alternategroup Name="GHI" Desc="GHI-Desc">
</alternategroup>
</revision-report>
Appreciate any help.
Thanks in advance for your attention.
JayThanks for your response.
I am not sure if there is any easier way, but I tried out the following tool available on the net to check an xml against a xsd:
http://tools.decisionsoft.com/schemaValidate/
There were a few issues, that I corrected and finally had a xsd and xml that were matching and valid. I tried this out in my file reading BPEL process, but the error still remained the same!
Here is my updated/simplified xsd and xml:
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema targetNamespace="http://xmlns.oracle.com/xmlfile"
xmlns:tns="http://xmlns.oracle.com/xmlfile"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://xmlns.oracle.com/xmlfile">
<xs:element name="revision-report">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="alternategroup"/>
</xs:sequence>
<xs:attribute name="doc" use="required" type="xs:string"/>
<xs:attribute name="model" use="required" type="xs:string"/>
<xs:attribute name="pubdate" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="alternategroup">
<xs:complexType>
<xs:attribute name="Name" use="required" type="xs:string"/>
<xs:attribute name="Desc" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8" ?>
<revision-report doc="doc2" model="model4" pubdate="pubdate5" xmlns="http://xmlns.oracle.com/xmlfile">
<alternategroup Name="ABC" Desc="ABC-Desc"/>
<alternategroup Name="DEF" Desc="DEF-Desc"/>
<alternategroup Name="GHI" Desc="GHI-Desc"/>
</revision-report>
I even tried the option that is available in JDeveloper to generate a sample xml from a xsd (when in the context of a Transformation activity). The xml generated by this also seems exactly like the one above.
So, I am not able to figure out why my BPEL process errors out with the message Invalid xml document. -
Splitting XML Files without namespaces
Hello,
I have a file that looks similar to this:
<?xml version="1.0" encoding="UTF-8"?>
<File>
<Header>
<Location>Phoenix</Location>
<Date>052214</Date>
</Header>
<Bill></Bill>
<Trailer>
<Total>1076</Total>
</Trailer>
</File>
What I would like to do is split the file (<Bill> is repeating) and I understand I should be able to do this with an envelope schema. I've done some research and every example I'm coming across happens to have a namespace in the sample schema.
How can I accomplish the same thing without the namespace?
Do I need to add the namespace using the ESB Toolkit, and if so, am I supposed to add a namespace to the repeating element? I looked into that solution and couldn't understand how to add a namespace to the Bill element, only the root. Unfortunately I trashed
that approach and went with an orchestration. While that is working, it just doesn't seem right if I can accomplish this task in the receive stage.
Any help/encouragement would be appreciated.The problem is that if you split the message on an element that has no namespace, you will need a Schema without namespace (in your case with a root element of "Bill" and no namespace).
Having Schemas without namespaces in BizTalk is bad practice and should, in general and if possible, be avoided.
So what I would do is create a custom Pipeline Component that (either using XDocument, XMLDocument or Regular Expression) appends a namespace to all "Bill" elements and also a namespace to the Root.
Apply the Component in the Decode Stage on your Receive Pipeline so that it is applied BEFORE the disassemble stage, and then create your "Bill" Schema with the newly appended Namespace, and also Apply the Batch namespace to your Envelope Schema.
An Example:
<?xml version="1.0" encoding="UTF-8"?>
<b:File xmlns:b="http://Batch">
<Header>
<Location>Phoenix</Location>
<Date>052214</Date>
</Header>
<c:Bill xmlns:c="http://namespace"></c:Bill>
<c:Bill xmlns:c="http://namespace"></c:Bill>
<c:Bill xmlns:c="http://namespace"></c:Bill>
<c:Bill xmlns:c="http://namespace"></c:Bill>
<Trailer>
<Total>1076</Total>
</Trailer>
</b:File>
Morten la Cour -
How must getElementsByTagName work on an xml file with namespaces?
Hello together,
is there any normative document, which specifies
which nodes must be returned by
the org.w3c.dom.Document method
getElementsByTagName when which was
created by a namespace aware dom parser
from an xml file containing namespaces?
In other words:
when you have an xml file:
<someprefix:somenode xmlns:someprefix="http://someuri">
<someprefix:innertag>
<someprefix:mostinnertag>
</someprefix:mostinnertag>
<someprefix:mostinnertag>
</someprefix:mostinnertag>
</someprefix:innertag>
</someprefix>
and you call
document.getElementsByTagName( ... );
1) How many nodes must be returned when giving
"mostinnertag" as parameter?
2) How many nodes when giving "someprefix:mostinnertag" as parameter?
Is it allowed to use the "non namespaceaware"
method and not "getElementsByTagNameNS"?
I know:
a) xerces returns 2 nodes when using
alternative 2 and none with alternative 1
b) oracle xml parser returns 2 nodes when using
alternative 1 and none when using alternative 2
Which implementation is right?
Yours
StefanI've got some problems with this methos and xerces too.
Perhaps the two implementations (xerces and oracle) are different. I mean xerces implementation gives you nodes of this name but without namespace and oracles's implementation gives you modes with namespace whose unprefix-name is "mostinnertag". -
How do I Ftp a XML file with out namespace attribute
Hi All,
How do I FTP an xml file that is validated against a schema on the ftp adapter with out the namespace attribute being added to the first and second element of the XML file.
For example the xml looks like this when I transfer the file.
<XML_Event xmlns="http://xmlns.oracle.com/PlannedEventSTORMRequestProcess/STORM">
<Event_Begin xmlns="">
<XML_File_Header>
<Originating_System>xxx</Originating_System>
<ID>387</ID>
</XML_File_Header>
</Event_Begin>
</XML_Event>
However I want it to be….
<XML_Event>
<Event_Begin>
<XML_File_Header>
<Originating_System>xxx</Originating_System>
<ID>387</ID>
</XML_File_Header>
</Event_Begin>
</XML_Event>
How do i achieve this using the ftp adapter.
CheersHere is an example that will try to reach the given size in steps of 4 in quality.
var saveFile = File(Folder.desktop + "/test");
var fileSize = 70;
try{
tmpFile = File(saveFile+".jpg");
for(var z =100;z>5;z -=4){
SaveForWeb(tmpFile,z);
var chkFile = File(saveFile+".jpg");
//$.writeln(tmpFile + " qual = " + z + " Size = " +(chkFile.length/1024).toFixed(2) + "k" );
if((chkFile.length/1024).toFixed(2) < (fileSize +1)) break;
tmpFile.remove();
if(!tmpFile.exists) SaveForWeb(tmpFile,5);
}catch(e){$.writeln(e + " - " + e.line);}
function SaveForWeb(saveFile,jpegQuality) {
var sfwOptions = new ExportOptionsSaveForWeb();
sfwOptions.format = SaveDocumentType.JPEG;
sfwOptions.includeProfile = false;
sfwOptions.interlaced = 0;
sfwOptions.optimized = true;
sfwOptions.quality = Number(jpegQuality);
activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);
Maybe you are looking for
-
I'm using Tiger 10.4.11 and had to wipe my drive and reload my system from the install discs yesterday, Now I'm running Itunes version 4! It won't let me access the store, I've tried everything on the help pages, EVERYTHING, I need a older version o
-
Error during acquisition transfer: Depr. area does not exist
Hi, I am getting following error while posting WBS through CJ88 Message no. AAPO107 Diagnosis According to the specifications for transfer variant 5, depreciation area 30 should be transferred gross. However, the recieving asset 3300053-1 does not ma
-
Import via firewire no longer working
Hi, I'm using iMovie 10.0.2, and trying to import from a Sony DCR-TRV320E camcorder over firewire into my late 2010 13" Macbook Pro under Mavericks. Everything is up to date software wise as of today. This setup worked fine under Lion (I skipped mou
-
Pls help me with this function
i want to write a function with parameters String striker,String nonstriker and Integer runsscored. how can i write this with the following conditions 1.when runsscored ==1 or 3 or 5 or 7 striker and nonstriker should interchange and in other conditi
-
I have just upgraded to itunes 7 and downloaded 2 games namely Tetris and Pacman. Both originally appeared in the left hand bar underneath music, movies etc but they have now disappeared. Tried downloading pacman again - once it downloaded it disappe