Parsing multiref elements
hi!
I am trying to parse xml documents with elements like the following.
<ns1:fullRequestResponse xmlns:ns1="http://some.name.space">
<token href="#ID1"/>
<result href="#ID2"/>
<charged href="#ID3"/>
</ns1:fullRequestResponse>...
<ns1:response id="ID2" xsi:type="ns1:response">
<result xsi:type="xsd:string">accepted</result>
<text xsi:type="xsd:string">accepted</text>
</ns1:response>Using DOM I only get an element with the attribute href="#ID2", the child element ( response ) is not accessible. Do I have to resolve the multiref by myself or can I use DOM (or JDOM, SAX., ...) to do that for me?
cheers,,
Philipp
I am currently faced with a similar issue. The following are the details. Any insights?
*** XML Document ***
<ns1:Body xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
<ns1:echoObjectResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://localhost:8080/axis/EchoHeaders.jws" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<ns1:echoObjectReturn href="#id0"/>
</ns1:echoObjectResponse>
<multiRef id="id0" soapenc:root="0" ns1:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<description xsi:type="ns2:string" xsi:nil="true" xmlns:ns2="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<id href="#id1"/>
<name xsi:type="soapenc:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Internet Widget</name>
</multiRef>
<multiRef id="id1" soapenc:root="0" ns1:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1</multiRef>
</ns1:Body>
*** Code for parsing ***
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse("c:\\sample.xml");
System.out.println("Printing multi-ref info: " + document.getElementsByTagNameNS("http://localhost:8080/axis/EchoHeaders.jws", "echoObjectResponse").getLength());
//// above prints the value 0
Thanks,
-ac
Similar Messages
-
SOAP-ERROR: Parsing Schema: element has both 'type' attribute and subtype
Hi,
i have created web service link which deals with calling a Pl/sql procedure with the help of DBAdapter in jdev 10.1.3.4 .here i am trying to insert a row in tables.my webservice is working fine from BPEL console
my collegue who is working on PHP is trying to access the the wsdl link with the help of Appcelator and php
code for php
<?php
//include("general.php");
$wsdl_url = 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/CreateRepairOrder/1.0/CreateRepairOrder?wsdl';
//$wsdl_url = 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl';
$client = new SoapClient($wsdl_url,array('trace' => 1,'exceptions' => 0));
print_r($client);
exit;
class CreateOrderNd
var $PARTY_ID="";
var $CUST_ACCOUNT_ID="";
var $INVENTORY_ITEM_ID="";
var $SERIAL_NUMBER="";
var $UNIT_OF_MEASURE="";
var $QUANTITY="";
var $ITEM_CROSS_REFERENCE="";
var $PROBLEM_DESCRIPTION="";
function CreateOrderNd($PartyNam,$AccountId,$ItemId_requestdata,$SerialNumber_requestdata,$uom_requestdata,
$quantity_requestdata,$ItemCrossReference_requestdata,$ProblemDescription_requestdata)
$this->PARTY_ID=$PartyName;
$this->CUST_ACCOUNT_ID=$AccountId;
$this->INVENTORY_ITEM_ID=$ItemId_requestdata;
$this->SERIAL_NUMBER=$SerialNumber_requestdata;
$this->UNIT_OF_MEASURE=$uom_requestdata;
$this->QUANTITY=$quantity_requestdata;
$this->ITEM_CROSS_REFERENCE=$ItemCrossReference_requestdata;
$this->PROBLEM_DESCRIPTION=$ProblemDescription_requestdata;
$parm = new CustomerNd($PartyName_requestdata,$AccountId_requestdata,$ItemId_requestdata,$SerialNumber_requestdata,$uom_requestdata,
$quantity_requestdata,$ItemCrossReference_requestdata,$ProblemDescription_requestdata);
$parm = new CustomerNd('Bus%','');
$parm = new CreateOrderNd(4429,1608,6761,'0722AB05','Ea',1,'abc123','Network error');
$ret=$client->process($parm);
print_r($ret);
?>
when she/he access it they are facing a error
SOAP-ERROR: Parsing Schema: element has both 'type' attribute and subtype
and some times it will give
Warning: SoapClient::SoapClient(http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl) http://function.SoapClient-SoapClient: failed to open stream: HTTP request failed! in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6
Warning: SoapClient::SoapClient() http://function.SoapClient-SoapClient: I/O warning : failed to load external entity "http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl" in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6
Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl' in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6Hi,
i have created web service link which deals with calling a Pl/sql procedure with the help of DBAdapter in jdev 10.1.3.4 .here i am trying to insert a row in tables.my webservice is working fine from BPEL console
my collegue who is working on PHP is trying to access the the wsdl link with the help of Appcelator and php
code for php
<?php
//include("general.php");
$wsdl_url = 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/CreateRepairOrder/1.0/CreateRepairOrder?wsdl';
//$wsdl_url = 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl';
$client = new SoapClient($wsdl_url,array('trace' => 1,'exceptions' => 0));
print_r($client);
exit;
class CreateOrderNd
var $PARTY_ID="";
var $CUST_ACCOUNT_ID="";
var $INVENTORY_ITEM_ID="";
var $SERIAL_NUMBER="";
var $UNIT_OF_MEASURE="";
var $QUANTITY="";
var $ITEM_CROSS_REFERENCE="";
var $PROBLEM_DESCRIPTION="";
function CreateOrderNd($PartyNam,$AccountId,$ItemId_requestdata,$SerialNumber_requestdata,$uom_requestdata,
$quantity_requestdata,$ItemCrossReference_requestdata,$ProblemDescription_requestdata)
$this->PARTY_ID=$PartyName;
$this->CUST_ACCOUNT_ID=$AccountId;
$this->INVENTORY_ITEM_ID=$ItemId_requestdata;
$this->SERIAL_NUMBER=$SerialNumber_requestdata;
$this->UNIT_OF_MEASURE=$uom_requestdata;
$this->QUANTITY=$quantity_requestdata;
$this->ITEM_CROSS_REFERENCE=$ItemCrossReference_requestdata;
$this->PROBLEM_DESCRIPTION=$ProblemDescription_requestdata;
$parm = new CustomerNd($PartyName_requestdata,$AccountId_requestdata,$ItemId_requestdata,$SerialNumber_requestdata,$uom_requestdata,
$quantity_requestdata,$ItemCrossReference_requestdata,$ProblemDescription_requestdata);
$parm = new CustomerNd('Bus%','');
$parm = new CreateOrderNd(4429,1608,6761,'0722AB05','Ea',1,'abc123','Network error');
$ret=$client->process($parm);
print_r($ret);
?>
when she/he access it they are facing a error
SOAP-ERROR: Parsing Schema: element has both 'type' attribute and subtype
and some times it will give
Warning: SoapClient::SoapClient(http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl) http://function.SoapClient-SoapClient: failed to open stream: HTTP request failed! in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6
Warning: SoapClient::SoapClient() http://function.SoapClient-SoapClient: I/O warning : failed to load external entity "http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl" in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6
Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl' in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6 -
Hi All,
I am getting error while loading XML in <fx:XML> tag.
Error:
TypeError: Error #1090: XML parser failure: element is malformed.
MXML Code:
<fx:Declarations>
<fx:XML id="xmlSource2" source="sample.xml"/>
</fx:Declarations>
Sample XML Used: (sample.xml)
<?xml version="1.0" encoding="UTF-8"?>
<File>
<Chemical id="000035676" displayFormula="C39-H45-N2-O6"
displayName="Dimethyltubocurarine">
<NameList>
<NameOfSubstance>
Dimethyltubocurarine
<SourceList>
<Source>MESH</Source>
</SourceList>
</NameOfSubstance>
<SystematicName>
Tubocuraranium, 6,6',7',12'-tetramethoxy-2,2',2'-trimethyl-
<SourceList>
<Source>NLM</Source>
</SourceList>
</SystematicName>
<Synonyms>
Dimethyltubocurarine
<SourceList>
<Source>NLM</Source>
</SourceList>
</Synonyms>
<Synonyms>
Dimethyltubocurarinium
<SourceList>
<Source>NLM</Source>
</SourceList>
</Synonyms>
<Synonyms>
Methyltubocurarinum
<SourceList>
<Source>NLM</Source>
</SourceList>
</Synonyms>
</NameList>
<NumberList>
<CASRegistryNumber>
35-67-6
<SourceList></SourceList>
</CASRegistryNumber>
<RelatedRegistryNumber>
518-26-3 (iodide.hydriodide)
<SourceList>
<Source>MESH</Source>
</SourceList>
</RelatedRegistryNumber>
</NumberList>
<ClassificationList>
<ClassificationCode>
Neuromuscular nondepolarizing agents
<SourceList>
<Source>MESH</Source>
</SourceList>
</ClassificationCode>
</ClassificationList>
<FormulaList>
<MolecularFormula>
C39-H45-N2-O6
<SourceList>
<Source>NLM</Source>
</SourceList>
</MolecularFormula>
</FormulaList>
<FormulaFragmentList></FormulaFragmentList>
<NoteList></NoteList>
<LocatorList>
<FileLocator
url="http://cnetdb.nci.nih.gov/cgi-bin/srchcgi.exe?DBID=****3&SFMT=****_basic%2F10%2F0%2F0&TYPE=search&SRCHFORM=passthru%3D%Asrchform%3ASRCH%3A&FIELD_001=[CAS]35-67-6&GoButton=Search&FIELD_001_CTL=EXPR&FIELD_908=&FIELD908_CTL=HASABSTRACT&FIELD_903=&FIELD_903_CTL=YEARFORE&DOCPAGE=10">CANCERLIT</FileLocator>
<FileLocator
url="http://toxnet.nlm.nih.gov/cgi-bin/sis/search/r?dbs+toxline:@and+@term+@rn+35-67-6+@term+@org+DART">DART/ETIC</FileLocator>
<FileLocator
url="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=PubMed&term=35-67-6[ECNO]+OR+"~"[MH]">MEDLINE</FileLocator>
<FileLocator
url="http://www.nlm.nih.gov/cgi/mesh/2K/MB_cgi?term=35-67-6&rn=1">MESH</FileLocator>
<FileLocator
url="http://toxnet.nlm.nih.gov/cgi-bin/sis/search/r?dbs+toxline:@term+@rn+35-67-6+@OR+@mh+""">TOXLINE</FileLocator>
</LocatorList>
</Chemical>
</File>
Also, when I am using HttpService to load same XML I am getting no such error!!
<s:HTTPService id="employeeService"
url="sample.xml"
result="employeeService_resultHandler(event)"
fault="employeeService_faultHandler(event)"/>
Please help!!
Thanks.
AbhinavI think url in XML is creating problem here.
<FileLocator
url="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=PubMed&term=23-95-0[ECNO]+OR+"~"[MH]">MEDLINE</FileLocator>
Is there any way to parse this XML using <fx:XML/> ??
Thanks. -
Hi,
When I call a webservice from SAP XI with the SOAP adapter then I get a response message in SAP XI without multiref elements from the webservice.
When I do the same thing with XMLspy I get a correct
message with multiref elements.
What do I wrong in SAP XI?
kind regards,
H. HendriksHi Stefan,
Yes I had set the keep attachment parameter.
kind regards,
H. Hendriks -
The multiRef elements are missing.
hello friends
I'm using the receiver soap adapters for consuming the axis 1.0 web services, in order to do this, i'm using the message types referenced in the wsdl imported.
But, the multiref elements are missing in the response message.
what I must do?
Regards.
Sergio Gómizhello Deviprasad !
I already imported the wsdl file like as external definition as WSDL Category Then I reused his message types for making the interface message.
The problem is that not recognizes following response payload (<altaInspeccionReturn href="#id0"/>)...
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:altaInspeccionResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://mansub.webservice.mansub.gom.com/">
<altaInspeccionReturn href="#id0"/>
</ns1:altaInspeccionResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:RespuestaOperacion" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:ServicioIntegracionMansub">
<codigoError xsi:type="xsd:int">0</codigoError>
<dato xsi:type="xsd:string" xsi:nil="true"/>
<mensaje xsi:type="xsd:string">inspeccion dada de alta</mensaje>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
In the monitoring adapter (runtime workbench) it appear this payload ...
- <ns1:altaInspeccionResponse xmlns:ns1="http://mansub.webservice.mansub.gom.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<altaInspeccionReturn href="#id0" />
</ns1:altaInspeccionResponse> -
I'm working on a project in maintenance which processes XML files via DOM. Now we want to process some very large XML files, and using DOM directly is causing an enormous memory overhead.
On the one hand I'd like to use something like SAX to reduce the memory overhead, and on the other I'd really like to allow the rest of the application to keep it's DOM processing code.
The application currently processes the file by creating a DOM for the whole document, and then breaking the document down into the elements directly under the root element. It then processes each of these "elements-just-one-level-under-the-root" as an isolated unit. Additionally - we know that, broken down in this way, the individual units are guaranteed to be small enough.
I'd like to process these units as DOM.
Looking through the JAXP APIs there doesn't seem to be any way to just parse part of a file, so I thought I'd be able to do it by writing my own DocumentHandler to check the parse position each time the startElement and endElement methods are called, then, once the whole file has been scanned in this way I could read it back in again but in chunks, creating little DOMs from the chunks. This method relies upon the parser updating the Locator object, but unfortuanately it only updates a line number. It's not possible to tell exactly where you are in the file this way.
Does anyone have any ideas how I might acheive my desired result - lot's of small DOMS, each one representing a single element directly under the root, without having to read the whole file into memory at once?Thanks - that's exactly what I'm trying to do!
It's step 2 that I'm having trouble with.
I could replicate the job of something like (for example) JDOM by receiving all events under the root and creating JDOM elements from the contents, but I was hoping to be able to use some library that did this for me (for example: jdom's SAXBuilder class).
The other side effect of this method is that you drive things from a SAX parser and let the document handler do the application work. Unfortuanately re-engineering the application to work from within a DocumentHandler is probably not an option.
But thankyou anyway :) -
XML Parser Message: Element series is not valid for the content model
Hello,
I work with FrameMaker 8 and DITA.
I change the element prodinfo in the topic.edd from:
General rule: (prodname), (vrmlist), (brand | series | platform | prognum | featnum | component)*
to:
General rule: (brand | series | platform | component)*
When I import the element definition to the template everything is okay.
When I insert the elements metadata, prodinfo, brand, series, platform and component into a topic I get the XML Parser Message that the element brand is not valid for the content model (prodname,vrmlist, ((brand|series|platform|prognum|featnum|component))*).
When I delete the element brand in the topic I get the XML Parser Message that the element series is not valid for the content model (prodname,vrmlist, ((brand|series|platform|prognum|featnum|component))*).
I change the element prodinfo in the topic.edd to:
General rule: (brand)?, (series)?, (platform)?, (component)?
...and get the same Parser Message.
I do not understand that. Is not it allowed to change the EDD this way without changing the DTD?
With kind regards
NinaHi Nina...<br /><br />In general, the EDD and DTD need to sync up. You can remove elements from an EDD element definition's general rule, as long as the resulting elements are still valid to the DTD. But if changing a general rule creates an invalid structure, you'll need to also change the DTD to allow the revised structure.<br /><br />With DITA, it is common to remove inline elements from block-level elements. For example, you might want to remove the <msgblock>, <msgnum>, and <msgph> elements from the general rule of the <p> element .. this can be done easily in the EDD and the resulting structure remains valid with the DTD.<br /><br />However, what you're doing leaves the <brand> element as a child of <prodinfo> .. which is invalid. You'll get these errors when saving a file, since this is when the file is validated against the DTD.<br /><br />I do not recommend modifying the structure in such a way that requires you to modify the DTD. If you really need to do this, then you should consider making a specialization to support your revised model.<br /><br />I hope this helps.<br /><br />Cheers and Happy New Year!<br /><br />...scott
-
Parsing error:Element "process" must have no character [children]
hi,
Please does any1 know how to fix this error ?
when deploying the poroject i got :
XML parsing failed because Element "process" must have no character [children], because the types content type is element-only......"
when double clicking on the above error, Jdevelopper takes me to the end of the process that is closed normally with the BPEL element </process>
Sorry i guess i'm flodding the Forum with my msgs, but am a beginner in the OraBPELPM.
Thanks,
RanaRana,
You'll probably get better answers for BPEL related questions if you post them on the BPEL forum here:
BPEL -
Error parsing! Element "process" must have no character [children],
hi,
Please does any1 know how to fix this error ?
when deploying the poroject i got :
XML parsing failed because Element "process" must have no character [children], because the types content type is element-only......"
when double clicking on the above error, Jdevelopper takes me to the end of the process that is closed normally with the BPEL element </process>
Sorry i guess i'm flodding the Forum with my msgs, but am a beginner in the OraBPELPM.
Thanks,
RanaSorry Ng for the delay,
Below is the simple .bpel cod eam trying to test:
"<process name="BpelDemoExample"
targetNamespace="http://xmlns.oracle.com/BpelDemoExample"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:IssuesWorkGroup="http://xmlns.oracle.com/BpelDemoExample"
xmlns:client="http://xmlns.oracle.com/BpelDemoExample">
-->
<partnerLinks>
<partnerLink name="IssuesWorkGroup" partnerLinkType="IssuesWorkGroupBPELDemoE" partnerRole="BpelDemoExampleProvider"/>
<partnerLink name="client" partnerLinkType="clientBPELDemoE" partnerRole="BpelDemoExampleRequester"/>
</partnerLinks>
<variables>
<variable name="AnnouceIssues_ProcessData" messageType="AnnouceIssues_ProcessDataMessage"/>
<variable name="outputVariable" messageType="BpelDemoExampleResponseMessage"/>
<variable name="Issueslistready" messageType="BpelDemoExampleRequestMessage"/>
</variables>
<sequence name="main" >
<receive partnerLink="IssuesWorkGroup" portType="processPort" operation="AnnouceIssues" variable="Issueslistready" createInstance="yes"/>
<wait name="HoldSixDays" for="6 days" until="38698"/>
<switch name="ReceivedEmail">
<case condition="Yes">
<sequence>
<invoke partnerLink="internal" name="CheckAgain" portType="processPort" operation="CheckAgain" inputVariable="outputVariable"/>
<empty/>
</sequence>
</case>
<otherwise>
<sequence>
<invoke partnerLink="client" name="PublishTheList" portType="processPort" operation="PublishTheList" inputVariable="outputVariable"/>
<empty/>
</sequence>
</otherwise>
</switch><!-- The detailed Mapping of all subProcesses -->
</sequence >
</process>
Thanks
Rana -
SAX error parsing by element. need help!
I am trying to develop a small method to that can parse an xml file and return an elements value. I got some code to build a SAXHandler. I have build the SAXHandler and have compiled it no problem.
import java.io.*;
import java.util.Hashtable;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
public class SAXHandler extends DefaultHandler {
private Hashtable table = new Hashtable();
private String currentElement = null;
private String currentValue = null;
public void setTable(Hashtable table) {
this.table = table;
public Hashtable getTable(){
return table;
public void startElement(String tag, Attributes attrs)
throws SAXException {
currentElement = tag;
public void characters(char[] ch, int start, int length)
throws SAXException {
currentValue = new String(ch, start, length);
public void endElement(String name) throws SAXException {
if (currentElement.equals(name)) {
table.put(currentElement, currentValue);
I am using the following code to read the file in and parse it.
public String getXMLElement(){
try {
File xmlFile = new File(appDataFile);
FileReader xmlRead = new FileReader(xmlFile);
XMLReader xmlParser;
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
SAXHandler handler = new SAXHandler();
sp.parse(new InputSource(xmlRead), handler);
i am recieving the following error when I try to run the servlet
javax.servlet.ServletException: Cannot allocate servlet instance for path /JDtrack/servlet/JDTrack
what makes this wierd is that is i take out the line
sp.parse(new InputSource(xmlRead), handler);
I do not get the error.
I am newer to java and could use all the help I can get
thanks.A few things to try to help identify the problem:
-Create and InputSource before parsing the file. If the InputSource cannot be created, there may be a problem with accessing the file from your servlet.
-Write a quick program to do the same thing from an application. If you can do this outside the servlet container, it may be a problem from running inside the servlet container.
-The code you listed is in a try block, however the catch block is not listed. If you are not already doing so, place debug message (to console or log) from inside each catch block. If an exception is thrown but not handled corrrectly, the servlet container may just throw a ServletException.
Hope this helps. -
Using HTMLEditorKit.Parser to parse embed elements
I've been using the HTMLEditorKit.Parser to do parsing on a html page just fine until I wanted to get an <embed> element inside of an <object>. The parser has no problem finding the <object> tag but then it doesn't seem to find the <embed> tag inside it. Does anyone know how to resolve this? Any help would be greatly appreciated. Thank you.
I have tested your method and I have not this problem.
you are right, new StringBuffer() intialize it
peraphs it's the way you use your method toString() ? -
Parsing (COunting Elements and Attributes)
Can anyone point me to the method sfor counting elements and attributes in a parsed XML document. For example, I have a XML document that contains a number of 'word' files, I need to produce a printout that gives the total number. The files have a size attribute and I need to calculate and printout the total size of all the files together
ChuckBing,
Thanks for the pointers. I now have the following method:
} public void startElement(String elementName, AttributeList al) throws SAXException
String attributeValue;
if (elementName.equals("PRICE"))
if(al.getLength()>0)
for(int j = 0;j<al.getLength();j++)
attributeValue = al.getValue(j);
System.out.println("Total Attribute value is " + attributeValue);
}This obviously allows me to extract the detail from "PRICE" but "PRICE" actually has two attributes. I can't find another method that allows me to extract out the detail for a specific attribute.
Can you suggest anything? -
Parsing error : Element already declared
Hi
I am facing problem while using namespace.
In a prototype, while using xml and dtd I tried to use namespace in using parameter entity. Despite using namespace I am getting error element already declared.
If I don't use parameter entity then the prototype works.
In the following prototype, poNmSpace.xml makes use of poNmSpace.dtd which in turn makes use of xhtml.dtd
I am trying to parse poNameSpace.xml using oracle parser and I am getting following error
Am I doing something wrong ?
** Parsing error, line 19, uri file:/D:/Users/Anup/work/Event/xml/Oracle/sa
x/paraEntyNmSpace/xml/poNmSpace.dtd
Element 'title' already declared.
file:/D:/Users/Anup/work/Event/xml/Oracle/sax/paraEntyNmSpace/xml/poNmSpace
.dtd<Line 19, Column 16>: XML-0131: (Error) Element 'title' already declare
d.
at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java, C
ompiled Code)
at oracle.xml.parser.v2.XMLError.flushErrors(XMLError.java:216)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValida
tingParser.java:247)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:151)
at Echo.main(Echo.java:58)
poNmSpace.xml
=============
<?xml version='1.0' encoding='us-ascii'?>
<!-- A SAMPLE purchase order -->
<!DOCTYPE purchaseorder SYSTEM "poNmSpace.dtd" [
<!ENTITY ponumber "1">
<!ENTITY copyright SYSTEM "copyright.xml">
]>
<!-- SUBSTITUTIONS WORK IN ATTRIBUTES, TOO -->
<purchaseorder
author="Anupam Vaval"
>
<!-- Makes use of the dynamic entity &ponumber; and ©right; from other XML file
copyright.xml -->
<title nsprefix:a1 = "v1"> This is sample title</title>
<ref refno="&ponumber;"></ref>
<message>©right;</message>
<message>purchase order &ponumber; generated</message>
</purchaseorder>
poNmSpace.dtd
=============
<?xml version='1.0' encoding='us-ascii'?>
<!--
DTD for a simple "purchase order".
-->
<!-- Defines the %inline; declaration -->
<!ENTITY % xhtml SYSTEM "xhtml.dtd">
%xhtml;
<!ELEMENT purchaseorder (title, ref, message*)>
<!ATTLIST purchaseorder
author CDATA "unknown"
>
<!ELEMENT title (%inline)*>
<!ATTLIST title nsprefix:a1 CDATA #IMPLIED>
<!ELEMENT ref (#PCDATA)>
<!ATTLIST ref
refno CDATA #IMPLIED
>
<!ELEMENT message (#PCDATA)>
xhtml.dtd
=========
<?xml version='1.0' encoding='us-ascii'?>
<!--
This DTD does some of what the W3C is getting ready to do with its
"XHTML" work (nee "Voyager"). It differs from the current WG draft
because it uses namespaces correctly (!), and it isn't as complete
even for HTML 3.2 support (much less 4.0) or, probably, correct.
Note that what XHTML needs to do is become modular enough that XHTML
can be used as a mixin with other document types, including either
"the whole megillah" or just selected modules (e.g. omitting tables).
That must work both ways ... other things as mixins to XHTML, and
XHTML as a mixin to other things.
THIS WILL BE REPLACED WITH A BETTER DTD AT SOME POINT.
-->
<!ELEMENT html (head, body)>
<!ATTLIST html
xmlns CDATA #FIXED "http://www.example.com/xhtml"
>
<!ELEMENT head (title,style*)>
<!ELEMENT title (#PCDATA)>
<!ATTLIST title nsprefix:a2 CDATA #IMPLIED>
<!ELEMENT style (#PCDATA)>
<!ATTLIST style
type CDATA #IMPLIED
>
<!ENTITY % content "p|h1|h2|h3|h4|h5|h6|ul|ol|table|center">
<!ENTITY % inline "#PCDATA|em|b|a|img|br">
<!ELEMENT em (#PCDATA|a|b|img|br)*>
<!ELEMENT b (#PCDATA|a|em|img|br)*>
<!ELEMENT a (#PCDATA|b|em|img|br)*>
<!ATTLIST a
href CDATA #IMPLIED
name CDATA #IMPLIED
>
<!ELEMENT br EMPTY>
<!ELEMENT img EMPTY>
<!ATTLIST img
alt CDATA #IMPLIED
border CDATA #IMPLIED
height CDATA #IMPLIED
src CDATA #REQUIRED
width CDATA #IMPLIED
>
<!ELEMENT body (%content;)+>
<!ATTLIST b ody
bgcolor CDATA #IMPLIED
>
<!ELEMENT p (%inline;)*>
<!ELEMENT h1 (%inline;)*>
<!ELEMENT h2 (%inline;)*>
<!ELEMENT h3 (%inline;)*>
<!ELEMENT h4 (%inline;)*>
<!ELEMENT h5 (%inline;)*>
<!ELEMENT h6 (%inline;)*>
<!ELEMENT ul (li+)>
<!ELEMENT ol (li+)>
<!ELEMENT li (%inline;)*>
<!ELEMENT table (tr+)>
<!ATTLIST table
height CDATA #IMPLIED
width CDATA #IMPLIED
align (left|center|right) #IMPLIED
cellspacing CDATA #IMPLIED
>
<!ELEMENT tr (td+)>
<!ATTLIST tr
align (left|center|right) #IMPLIED
valign (top|center|bottom|baseline) #IMPLIED
>
<!ELEMENT td (%inline;|%content;)*>
<!ATTLIST td
height CDATA #IMPLIED
width CDATA #IMPLIED
align (left|center|right) #IMPLIED
valign (top|center|bottom|baseline) #IMPLIED
rowspan CDATA #IMPLIED
colspan CDATA #IMPLIED
>
<!ELEMENT center (%inline;|%content;)*>Rana,
You'll probably get better answers for BPEL related questions if you post them on the BPEL forum here:
BPEL -
Parse XML Elements/Attributes from CLOB into Oracle Table
Hi!
I have an XML file (loaded into a CLOB) which I need to parse and have each individual element and attribute inserted into an oracle table for manipulation.
Eg: XML File...
<PERSON>
<PER_ID changed="1">1</PER_ID>
<SURNAME changed="1">MARTIN</SURNAME>
<ADDRESS>
<STREET_NO changed="1">1</STREET_NO>
<POSTCODE changed="1">LE3 8RA</POSTCODE>
</ADDRESS>
</PERSON>
There will only ever be one address.
From this I need to extract
* PER_ID and related changed attribute
* SURNAME and related changed attribute
* STREET_NO and related changed attribute
* POSTCODE and related changed attribute
and insert a single record into the table below:
CREATE TABLE PERSON AS
( PER_ID VARCHAR2(10)
, ID_CHANGED VARCHAR2(1)
, SURNAME VARCHAR2(30)
, ID_CHANGED VARCHAR2(1)
, STREET_NO VARCHAR2(5)
, ID_CHANGED VARCHAR2(1)
, POSTCODE VARCHAR2(10) );
Any assistance/advice would be very much appreciated. I've tried using DBMS_XMLSave / DBMS_XMLStore which works great at pulling in elements (PER_ID, SURNAME, etc) straight into the table but doesn't look at the changed attributes, and I need both.
Thanks a million in advance to anyone who can crack this!!
JayTry looking at this thread
Loading datafrom a PL/SQL table into the Database table -
Weblogic 6.1 and xml parser empty elements
FYI, It looks like Weblogic changed there xml parser in the transition from
6.0sp2 to 6.1. Example : The empty Extra Info Class produced and error,
because it is empty. Where in 6.0sp2 it did not produce and error:
<taglib>
<tag>
<name>indexProperty</name>
<info>
some info..
</info>
<tagclass>com.pssg.jsp.tags.IndexPropertyTag</tagclass>
<teiclass></teiclass>
</tag>
</taglib>
####<Aug 20, 2001 12:20:52 PM PDT> <Info> <HTTP> <devlwebejb1> <camserver>
<ExecuteThread: '14' for queue: 'default'> <> <> <101047>
<[WebAppServletContext(7008653,cam,/cam)] resolved taglib uri '/pssglibtags'
to taglib-location /WEB-INF/tlds/pssgtaglib.tld:>
####<Aug 20, 2001 12:20:53 PM PDT> <Info> <HTTP> <devlwebejb1> <camserver>
<ExecuteThread: '14' for queue: 'default'> <> <> <101160> <Deployment
descriptor is malformed, check against the DTD:
org.xml.sax.SAXParseException: The content of element type "tag" must match
"(name,tagclass,teiclass?,bodycontent?,info?,attribute*)"..>
####<Aug 20, 2001 12:20:53 PM PDT> <Error> <HTTP> <devlwebejb1> <camserver>
<ExecuteThread: '14' for queue: 'default'> <> <> <101020>
<[WebAppServletContext(7008653,cam,/cam)] Servlet failed with Exception>
weblogic.servlet.jsp.JspException: (line 1): Error in using tag library
uri='/pssglibtags' prefix='pssglibtag': For tag 'indexProperty', cannot load
extra info class ''
at
weblogic.servlet.jsp.StandardTagLib.tld_jspException(StandardTagLib.java:901
-Scothi,
there are two versions of ldap supported in wls6.1 , ldapv1 and ldavp2
ldap v1 only has the functionality of listing groups.
but where ldapv2 doesn't have that functionality,
by looking at your config , it seems you are using ldap v2..
if u need that functionality u can use ldapv1.
thanks
kiran
"Bert Cliche" <[email protected]> wrote in message
news:[email protected]..
Per a proof of concept, I am having trouble getting WL6.1 to see
group members as defined in iPlanet LDAP. I can see the groups,
but modifies to create groups only create them in the local DB.
Created users also only get placed in the local DB. I can bind
for searches as Directory Manager via ldapsearch and run queries,
and the DS gateway works fine. I can dump the LDIF file and the
entries look fine.
I copied and modified the template for the Netscape server and
have the realm setup per the GUI.
For sanity, everything is very generic as:
the Root DN is "o=test.org"
and my "Configuration" part from the config.xml looks like:
server.authprotocol=simple;
server.host=localhost;
membership.filter=(&(uniquemember=%M)(objectclass=groupofuniquenames));
server.port=390;
group.dn=o=test.org;
group.filter=(&(cn=%g)(objectclass=groupofuniquenames));
server.principal=cn=Directory Manager;
user.dn=o=test.org;
server.groupiscontext=false;
user.filter=(&(uid=%u))
I added the "authprotocol" as a guess. Note that the server is
running on port 390, this is not a typo.
Any ideas what is going wrong?
Maybe you are looking for
-
Can you undo deleting a song/ file/ project ?
So I was about to export this song I just edited (it came out PERFECT) but when I tried to export via mail, it said I did not have space. So I started to delete other songs and I forgot to uncheck the song i wanted to export and now it got deleted a
-
How can I get my original i-tunes to show up on my macbook pro? I changed my Apple ID and password and now it's nowhere to be found. Can someone help me? Thanks
-
New ipod has erased all memory twice after trying to upload new songs
new ipod has erased all memory twice after uploading new songs - has asked me to register the ipod 14 times - each time I have completed the registration, it gets halfway through uploading 668 songs from my itunes library and then stops - now the fol
-
MacPro (2008) is not starting ...
2008 Mac Pro Running 10.8 mountain lion Won't start at all ... Just blank screen I try starting with option, nothing I try starting with command-R, nothing, no recovery partition , although I know it's there, have used it before, Just nothing! Help!
-
Passing multiple rows of data as an XML input to a transaction
Hi, I have a grid with several rows and columns of data on the front-end UI. I would like to select few rows and pass the data as an XML structure to a transaction. Is this possible? If so, how could I do this? Regards, Chanti.