XML ContentHandler (URGENT)
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import javax.xml.parsers.*;
public class BandRead {
public void read() throws Exception {
SAXParserFactory spf = SAXParserFactory.newInstance();
XMLReader parser = null;
SAXParser saxParser = spf.newSAXParser();
parser = saxParser.getXMLReader();
parser.setContentHandler(this);
parser.parse("file:///c:/Program files/Jcreator le/myprojects/band.xml");
public void startDocument() throws SAXException {
System.out.println("Starting ...");
public void endDocument() throws SAXException {
System.out.println("... Finished");
public static void main(String[] args) throws Exception {
System.out.println("Let's go parse!");
BandRead x = new BandRead();
x.read();
I having problems with setting the ContentHandler... Since now SAX 2.0 is used, the DefaultHandler is deprecated. What do I do? Make my own ContentHandler? And If I do, what do I do with the methods? What do I put in when overridding? (URGENT)
Er I found the answer already thanks.
In case to those who found the same problem as me, (Due to using books in the library that are using the deprecated information without any information of where to go) you have to create an inner class that implements ContentHandler and you have to override all the methods. Basically you can leave the unknown methods alone. ex.
public void startPrefixMapping(String prefix, String uri) {}
Similar Messages
-
Hi,
I want to build XML file like this(below one) in .NET.I am
getting one sub element i.e Year .But I am not getting Item and its
attributes within the Year element.Its very Urgent.I am using XML
serializer for this.
<energyrecap>
<year id="2006">
<item type="usage" value="4.666" month="Jan" />
<item type="usage" value="4.666" month="Feb" />
<item type="usage" value="4.666" month="Mar" />
<item type="usage" value="4.666" month="Apr" />
</year>
<year id="2007">
<item type="usage" value="5.666" month="Sep" />
<item type="usage" value="4.666" month="Oct" />
<item type="usage" value="3.666" month="Nov" />
<item type="usage" value="5.666" month="Dec" />
</year>
</energyrecap>You'll have a lot more luck with this question on dot.net
forum than here.
I use dot.net to return xml, but I have never used
XMLSerializer.
Tracy -
Oracle 8i XML Support (Urgent !)
Hi
I would like to know the support offered by Oracle 8i for
storing XML documents in database and querying on them.
What component of 8i offers this support and in what way is it
different from support offered by PLSXML ?
I am looking to store XML documents in Oracle 8i database and
querying on them. Also I want to extract data from database and
dynamically generate HTML paged for on-line viewing.
This information is very crucial to me. Help of any kind is
welcome on the same.
Hoping for some quick replies,
Premal Mehta.
nullI am not sure to which features you refer? If you are asking
about the CONTAINS operator that works in 8i now. The document
registration to a schema will be delivered in the iFS beta.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
Samuil Angelov (guest) wrote:
: As I have the same kind of a problem and need an urgent
solution
: of it I need information whether these features will be
: implemented in the beta version of iFS that is to be released.
: Regards
: Samuil
: Oracle XML Team wrote:
: : Currently you can store your documents in CLOBs and use
: : intermedia Text to search for data between tags with its
: CONTAINS
: : operator. When we release iFS you will be able to break
apart
: : that document and insert its data into tables based upon a
DTD
: to
: : Schema registration file and do additional SQL queries as
well.
: : Check out
: http://www.oracle.com/database/options/intermedia.html
: : and http://www.oracle.com/database/options/ifs.html for more
: : details.
: : Oracle XML Team
: : Oracle Technology Network
: : Premal Mehta (guest) wrote:
: : : Hi
: : : I would like to know the support offered by Oracle 8i
for
: : : storing XML documents in database and querying on them.
: : : What component of 8i offers this support and in what way
is
: : it
: : : different from support offered by PLSXML ?
: : : I am looking to store XML documents in Oracle 8i database
: and
: : : querying on them. Also I want to extract data from database
: and
: : : dynamically generate HTML paged for on-line viewing.
: : : This information is very crucial to me. Help of any kind
is
: : : welcome on the same.
: : : Hoping for some quick replies,
: : : Premal Mehta.
: : http://technet.oracle.com
null -
*** XML MESSAGES (URGENT PLEASE) ***
Hi,
we are using XI 3.0 support pack 20, having some problem to XML messages to emil
tr: SXMB_MONI shows all alerts from different servers, and eamil only my user with Subject: Alert and attachment file...
I didn't define any attachment file, or when I change continer variables nothing changed anyting...
I am sending some screen shot please figure it out where i am getting mistake....
http://www.flickr.com/photos/25222280@N03/
and I am following this doc.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0b4580be-0601-0010-d3ad-bd6ce51ae916
Note: This is very urgent please
Thanks in advancedI would start with fixing the "unable to convert sender system" error..
Michals blog for solution...
/people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system
Regards
Ravi Raman -
hi !
i want to create an xml file frim hierarchical data (n depth) . please advise me how to create xml file using dom and how to write dom elements to disk...read the documentation foor DOM it is not hard. You can create root elements, then append children to them, finally you can seralize the DOM Tree you just built
-
Need help with XML delay URGENT!!!
Hi i need help making a flash movie to load everything from
xml. It has to load text, images and flv, but, it has to load them
and end them at the time said in the xml. So flash loads and
unloade the text or image or video at the time specified in the
XML! PLEASE HELP I NEED THIS DONE TODAY!!!!! VERY IMPORTANT!!!
Contact me by msn [email protected] or send mail or
reply here!!It was probably a little unclear initially (no offence
intended ) whether your problem was with getting the data from XML
or with the sequencing aspect. I assume that its the sequencing
aspect based on your recent reply.
So if it was me I would parse the loaded info into Date
objects for the load and remove times and have this information
handled by some sort of sequencing code.
At its simplest, you could compare the xml-derived date/times
for load/unload with the current system date/time and use a
setInterval function to initiate the load after the calculated
difference in milliseconds has passed. Similar for the removeclip
timing. -
Hi,
I'm able to extract the Document out of the XML stored in the DB. I'm doing some changes like inserting new elements and removing some elements from the Document. How do I save the new Document back to the database?
The following is the code fragment:
String queryStr = "select e.xmlcol from TEMP_XML_AP e where e.fname='pid_cn_cn_ap_all_big.series_u_1115.xml'";
OraclePreparedStatement ostmt = (OraclePreparedStatement)con.prepareStatement(queryStr);
ResultSet rs = ostmt.executeQuery();
OracleResultSet orset = (OracleResultSet)rs;
while(orset.next())
{ OPAQUE op = orset.getOPAQUE(1);
XMLType theXML = XMLType.createXML(op);//;
Document doc = (Document)theXML.getDOM();
//add new element
doc.createTextNode("TEST");
//remove child
doc.removeChild("xyz");
Please tell me how to store back the updated document.
ThanksYou'll have a lot more luck with this question on dot.net
forum than here.
I use dot.net to return xml, but I have never used
XMLSerializer.
Tracy -
I am trying to generate an XML file from a database table. I loaded the xmlparser for java into the database and executed the catxsu.sql script as indicated in the documentation. All the relevant files are in the Oracle Home. There is a sample script in the documentation and I have tried to run it from SQLplus. I set the serveroutput to on so I could see the results. The following shows the code I used and the errors. Any suggestions as to what the problem is? Thanks
SQL> declare
2 queryCtx DBMS_XMLquery.ctxType;
3 result CLOB;
4 begin
5 queryCtx := DBMS_XMLquery.newContext('select * from emp_LOH');
6 result := DBMS_XMLQuery.getXML(queryCtx);
7 PrintClobOut(result);
8 DBMS_XMLQuery.closeContext(queryCtx);
9 end;
10 /
PrintClobOut(result);
ERROR at line 7:
ORA-06550: line 7, column 1:
PLS-00201: identifier 'PRINTCLOBOUT' must be declared
ORA-06550: line 7, column 1:
PL/SQL: Statement ignoredI created the PrintClobOut procedure and now I get the following errors when I execute the code:
SQL> declare
2 queryCtx DBMS_XMLquery.ctxType;
3 result CLOB;
4 begin
5 queryCtx := DBMS_XMLquery.newContext('select * from emp_LOH');
6 result := DBMS_XMLQuery.getXML(queryCtx);
7 PrintClobOut(result);
8 DBMS_XMLQuery.closeContext(queryCtx);
9 end;
10 /
declare
ERROR at line 1:
ORA-29540: class oracle/xml/sql/query/OracleXMLStaticQuery does not exist
ORA-06512: at "SYSTEM.DBMS_XMLQUERY", line 46
ORA-06512: at line 5 -
About XML/XSL:Urgent
Hai ,
I am developing one module which invloves XML database ,XSL and Javascript. In this I want to transform XML data to XHTML form using XSLT ., I have done this ,(using xsl templates ,In my form two radio buttons one dropdown box and two text boxes are there .). All the information which ever is displayed coming from XML ., ----- But I want to validate this elements (which are in xslt ,ie checking text box is empty or not ..) Where I have to add script in XSL ., Plz give simple example on this[/b
Thank You .,
Praveen]And what does that have to do with XML Publisher?
-
on release function i am inserting this value
"(&-box*&", "&*box-&
" in to my text box,
in text box will display like this (squarebox), when i am
trying to delete
squarebox ,
box deleting but
(&-box*&", "&*box-&
these xml elements are showing , what i have to
do ? it has to delete,
it amy have multipule box in my equation. how do delete xml
elements in this case, this is my xml code. how to delete? any one
can help me?Then you should provide more details on what you want this new script should do.
To "delete XML tags in already tagged text", all you need is use the "untag" command on an XML Element. But how would the script "know" what XML Element should be untagged?
Disclaimer: This reply is in no way enforceable, legally binding, a promise or contract, an agreement (written, verbal, or otherwise), a commitment, obligation, or free or paid-for offer of any kind to further help, guide, aid, tip, or not hinder you, or contribute to, correct, investigate, comment on or assist with any existing, forthcoming, or planned project. -
Can´t Open Model XML file - URGENT
Hi all,
I have made a model in SQL Developer Data Modeling, and save it. Now when I open the xml file the model is empty, but the all the information about entities and relations are on the other directory xml files. I send the main xml and the whole directory for evaluation... Can you please help, its about 1 week work... :(
Regards,
Sérgio TeixeiraHello Sergio,
I'm sorry for your problems. I'll try to help you if you send me your design ( design xml file and directory with the same name).
I see that mail information is hidden in the forum. You can use feedback application http://apex.oracle.com/pls/otn/f?p=2306:101 to post the problem.
Best regards,
Philip -
Convert BLOB from database to XML. - *URGENT*
Hi,
I have converted xml data into BLOB object and inserted into database.
Now when I retrieve the BLOB object,from my DB, using DBadapter, in the invokeOutputVariable, i have the following. This i copied from the 'Flow Trace'
<Invoke1_GetSourceXML_OutputVariable>
<part name="GetSourceXMLOutputCollection" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<GetSourceXMLOutputCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/GetSourceXML">
<GetSourceXMLOutput>
<INSTANCE_ID>1</INSTANCE_ID>
*<SOURCE_XML>weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB@78f9a</SOURCE_XML>*
<TARGET_XML xsi:nil="true"/>
<ORDER_ID>1</ORDER_ID>
<TASK_INSTANCE_ID>1</TASK_INSTANCE_ID>
<ORDER_DATE xsi:nil="true"/>
<TRANSLATION_TYP_CD xsi:nil="true"/>
<EBM_ID>1</EBM_ID>
<STATUS xsi:nil="true"/>
<STATUS_DETAIL xsi:nil="true"/>
</GetSourceXMLOutput>
</GetSourceXMLOutputCollection>
</part>
</Invoke1_GetSourceXML_OutputVariable>
1) Here i want to confirm, whether we l get weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB@78f9a sort of value when we retrieve a BLOB object.
2) Variable declaration is like below.
<variable name="binaryXML" type="xsd:string"/>
<variable name="decodedString" type="xsd:string"/>
binaryXML - value assignment_
<assign name="Assign2">
<copy>
<from variable="Invoke1_GetSourceXML_OutputVariable"
part="GetSourceXMLOutputCollection"
query="/ns2:GetSourceXMLOutputCollection/ns2:GetSourceXMLOutput/ns2:*SOURCE_XML*"/>
<to variable="binaryXML"/>
</copy>
</assign>
I have written java embedding code for converting this BLOB to xml as below
String input = (String)getVariableData("binaryXML");
try
/* *** INITIALLY I TRIED LIKE THIS*** */
//byte[] decodedBytes = Base64Decoder.decode(input.getBytes());
//String decoded = new String(decodedBytes);
//setVariableData("decodedString",decoded);
/* *** MY NEW CODE *** /
String decoded = Base64Decoder.decode(input);
setVariableData("decodedString",decoded);
catch(Exception ex)
ex.printStackTrace();
My Doubt
When I try to write this 'decodedString' to a .txt file, I couldnt find any output there.
<assign name="Assign3">
<copy>
<from variable="decodedString"/>
<to variable="Invoke2_Write_InputVariable" part="body"
query="/ns4:Root/ns4:C1"/>
</copy>
</assign>
Regarding the schema for the file to be written, i tried with 'opaque' schema.. I dint work. Later i tried with the schema as below (which is comma delimited)
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://TargetNamespace.com/WriteToFile"
targetNamespace="http://TargetNamespace.com/WriteToFile"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
nxsd:version="NXSD"
nxsd:stream="chars"
nxsd:encoding="US-ASCII"
>
<xsd:element name="Root">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="C1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy=""" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Kindly help me in ths regard.
Thanks,
Sabarisri. N
Edited by: Sabarisri N on Jul 22, 2011 2:37 PMRead this :
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14252/adx_j_xsu.htm#sthref508 -
Validation of bdmconfig.xml. Urgent!
Hello,
When I use the command : java weblogic.wtc.gwt.WTCValidateCF bdmconfig.xml
I receive the following message :
E:\bea\wlserver6.0\config\StecardDom>e:/bea/jdk130/bin/java -classpath e:/bea/jd
k130/lib/jatmi.jar;e:/bea/wlserver6.0/lib/weblogic.jar;e:/bea/jdk130/lib/tools.j
ar;e:/bea/wlserver6.0/config/StecardDom/applications/stecard/Web-inf/classes web
logic.wtc.gwt.WTCValidateCF bdmconfig.xml Validating Config file bdmconfig.xml...
ERROR: Can not create TDMResources object, reason(java.lang.NullPointerException
)! ERROR: Could not complete processing of element T_DM_RESOURCES ERROR: Failed to
extract the config attributes. ERROR: Validation failed for configuration XML file!
Here is my bdmconfig.xml (I have just remove IP addresses):
<?xml version="1.0"?>
<!DOCTYPE BDMCONFIG SYSTEM "..\..\..\wtc1.0\weblogic\wtc\gwt\wtc_config_1_0.dtd">
<!--Java and XML-->
<WTC_CONFIG>
<BDMCONFIG>
<T_DM_LOCAL_TDOMAIN AccessPoint="WTC">
<WlsClusterName>Coolio</WlsClusterName>
<AccessPointId>WTC</AccessPointId>
<Type>TDOMAIN</Type>
<Security>NONE</Security>
<Interoperate>yes</Interoperate>
<NWAddr>//10.6.12.116:7001</NWAddr>
</T_DM_LOCAL_TDOMAIN>
<T_DM_REMOTE_TDOMAIN AccessPoint="B_GATE">
<LocalAccessPoint>WTC</LocalAccessPoint>
<AccessPointId>B_GATE</AccessPointId>
<Type>TDOMAIN</Type>
<NWAddr>//190.0.0.2:20000</NWAddr>
</T_DM_REMOTE_TDOMAIN>
<T_DM_IMPORT
ResourceName="Padm_ihm"
LocalAccessPoint="WTC"
RemoteAccessPointList="B_GATE">
<TranTime>600</TranTime>
</T_DM_IMPORT>
<T_DM_RESOURCES>
<FieldTables>
<FldTblClass Type="fml16">stecard.uti.IhmFMLTable</FldTblClass>
</FieldTables>
</T_DM_RESOURCES>
</BDMCONFIG>
</WTC_CONFIG>
I try without validate my bdmconfig.xml and when I start WLS I receive this message
Improperly formated config file : .\config\StecardDom\bdmconfig.xml
Thanks for your help.
(Excuse me for my english I am french)I already use WTCStartup and with debug I receive the following message :
<10 juil. 02 11:09:14 CEST> <Info> <WebLogicServer> <Invoking startup class: web
logic.wtc.gwt.WTCStartup.startup(BDMCONFIG=.\config\StecardDom\bdmconfig.xml,Tra
ceLevel=100000)>
<10 juil. 02 11:09:14 CEST> <Info> <WTC> <Start loading the config file: .\confi
g\StecardDom\bdmconfig.xml>
<10 juil. 02 11:09:14 CEST> <Debug> <WTC> <[/WTCStartup/loadFile/>
<10 juil. 02 11:09:14 CEST> <Error> <WTC> <Improperly formated config file .\con
fig\StecardDom\bdmconfig.xml>
<10 juil. 02 11:09:14 CEST> <Debug> <WTC> <]/WTCStartup/loadFile/50/void>
<10 juil. 02 11:09:14 CEST> <Info> <WebLogicServer> <weblogic.wtc.gwt.WTCStartup
reports: null>
Thanks for help.
Bob Finan <[email protected]> wrote:
Hello Martin,
The validation failure is a problem in the WTCValidateCF utility
and a fix may be available from customer support.
The "Improperly formatted" error message is a little confusing
because it indicates you are using an early version than the
WTCValidateCF was available in(or maybe even FieldTables)
If you are running with the service pack 2 for WLS 6.0, the latest,
then it could be that you need to transition from the older version
of startup/shutdown classes to the newer versions.
(eg OatmialStartup/OatmialShutdown=>WTCStartup/WTCShutdown).
You may try turning on tracing, set the TraceLevel argument for
the startup class, and the additional debug info in the WLS log should
help with narrowing down the problem.
Bob Finan
Martin Erwan wrote:
Hello,
When I use the command : java weblogic.wtc.gwt.WTCValidateCF bdmconfig.xml
I receive the following message :
E:\bea\wlserver6.0\config\StecardDom>e:/bea/jdk130/bin/java -classpathe:/bea/jd
k130/lib/jatmi.jar;e:/bea/wlserver6.0/lib/weblogic.jar;e:/bea/jdk130/lib/tools.j
ar;e:/bea/wlserver6.0/config/StecardDom/applications/stecard/Web-inf/classesweb
logic.wtc.gwt.WTCValidateCF bdmconfig.xml Validating Config file bdmconfig.xml...
ERROR: Can not create TDMResources object, reason(java.lang.NullPointerException
)! ERROR: Could not complete processing of element T_DM_RESOURCES ERROR:Failed to
extract the config attributes. ERROR: Validation failed for configurationXML file!
Here is my bdmconfig.xml (I have just remove IP addresses):
<?xml version="1.0"?>
<!DOCTYPE BDMCONFIG SYSTEM "..\..\..\wtc1.0\weblogic\wtc\gwt\wtc_config_1_0.dtd">
<!--Java and XML-->
<WTC_CONFIG>
<BDMCONFIG>
<T_DM_LOCAL_TDOMAIN AccessPoint="WTC">
<WlsClusterName>Coolio</WlsClusterName>
<AccessPointId>WTC</AccessPointId>
<Type>TDOMAIN</Type>
<Security>NONE</Security>
<Interoperate>yes</Interoperate>
<NWAddr>//10.6.12.116:7001</NWAddr>
</T_DM_LOCAL_TDOMAIN>
<T_DM_REMOTE_TDOMAIN AccessPoint="B_GATE">
<LocalAccessPoint>WTC</LocalAccessPoint>
<AccessPointId>B_GATE</AccessPointId>
<Type>TDOMAIN</Type>
<NWAddr>//190.0.0.2:20000</NWAddr>
</T_DM_REMOTE_TDOMAIN>
<T_DM_IMPORT
ResourceName="Padm_ihm"
LocalAccessPoint="WTC"
RemoteAccessPointList="B_GATE">
<TranTime>600</TranTime>
</T_DM_IMPORT>
<T_DM_RESOURCES>
<FieldTables>
<FldTblClass Type="fml16">stecard.uti.IhmFMLTable</FldTblClass>
</FieldTables>
</T_DM_RESOURCES>
</BDMCONFIG>
</WTC_CONFIG>
I try without validate my bdmconfig.xml and when I start WLS I receivethis message
Improperly formated config file : .\config\StecardDom\bdmconfig.xml
Thanks for your help.
(Excuse me for my english I am french) -
Unable to validate against XML schema-URGENT!!!!
Hi,
I'm new to JAXP. I've been trying to validate an XML document against a Schema. But the error I get is as following:
java Schema org.xml.sax.SAXNotRecognizedException:
Property: http://java.sun.com/xml/jaxp/properties/schemaLanguage
at org.apache.crimson.parser.XMLReaderImpl.setProperty(XMLReaderImpl.java:272)
at org.apache.crimson.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:190) at Schema.main(Schema.java:20)
I understand that this problem is because my system is using the old default Crimson parser.
could some one please help me out with installing and using the latest Xerces parser.
1. I have jdk 1.4.2
2. I have JWSDP 1.4( can the jar files there help or do I have to download the jar's from apache?)
3. please let me know the full trouble shooting process including where should I place the jar files or how should I set the classpath.
4. would this affect validating against a DTD(which works fine now)
thanks in advance.
cheers
R43JAXP SAXParser produces the error
java Schema org.xml.sax.SAXNotRecognizedException:
Property: http://java.sun.com/xml/jaxp/properties/schemaLanguage -
Web.xml & RDBMSRealm URGENT
Hi All,
I am using WLS5.1 and RDBMS Realm. I have group called 'IS_Dept','HR_Dept' setup
in Realm.How do I set the same in web.xml file and weblogic.xml while deploying
WebApp.
NOTE: I have specified RDBMSRealm in weblogic.properties.
regards
sanjeev
I don't use Extensis Suitcase, however, after the Muse upgrade, when I was in Australia, it didn't work. Later, they did, so it all seems OK now.
Best,
Rick
Maybe you are looking for
-
Linksys e2000 router Open NAT troubleshooting multiple xbox 360's
Hello, I've been searching for about 4 hours now how to fix my NAT problems. I thought it had it working on one xbox in my bedroom, as it said OPEN NAT. But, when I looked at my Xbox in the living room, it said MODERATE NAT. How can I get these both
-
Purchase Online vs. In Store
I am considering purchasing the new iMac, and live very close to a retail Apple store. Any advice as to advantages and disadvantages of purchasing online vs. at the retail store? Cost? Customization? Support differences? Any insight is appreciated. T
-
DP Planning in Fiscal Periods and Fiscal Weekly Periods
Hi, We are using fiscal calnedar that starts on first Sunday of Nov with 4 weeks in each period i.e., fiscal year 2009 started on Nov 2nd (Sunday) and first period goes from Nov 2nd (Sunday) to Nov 29th (Saturday) and so on. So, our fiscal week also
-
Shortcut to new server volume mounts old server
I have recently transferred all files from a Windows NT Server and a Windows 2000 Server to an OSX Tiger Server. I duplicated the files to the new server using Retrospect but have left copies on the old server in case anything was missed. On my four
-
SMC and RMIERROR in Solaris 10
I spent a while trying to find the Solaris Management Console in Solaris 10 via Java Desktop System so I could easily create a number of users etc. I found it and ran it and was pleasantly suprised to see it run OK first time. I logged in with root u