Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Validating the XML with DOM Parser (Xerces)

843834Aug 21 2006 — edited Aug 5 2008
Hi All,

I am using DOMParser for Generating the XML. Now I need to convert the Given XML into another type of XML using XSL Transformations. Till this point I am fine but I need to validate the output of Transformation.

The Sample snippet of the code when I am trying to valiadate the below-mentioned XML

m_parser.setFeature("http://xml.org/sax/features/validation", true);
m_parser.setFeature("http://apache.org/xml/features/allow-java-encodings", true);

m_parser.parse(XML);

I am getting the following error : java.net.MalformedURLException: no protocol:

XML generated by applying the XSL Transformation

<env:Envelope xmlns:rm="OTC_RM_01-Jan-2006" xmlns:mtc="OTC_Matching_01-Jan-2006" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fpml="http://www.fpml.org/2005/FpML-4-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="OTC_RM_01-Jan-2006 /xmls/OTC/OTC_RM_01-Jan-2006.xsd
OTC_Matching_01-Jan-2006 /xmls/OTC/OTC_Matching_01-Jan-2006.xsd http://schemas.xmlsoap.org/soap/envelope/ /xmls/OTC/soap-envelope.xsd http://www.fpml.org/2005/FpML-4-2 /xmls/OTC/fpml-main-4-2.xsd">
<env:Header>
<OTC_RM xmlns="OTC_RM_01-Jan-2006">
<Manifest>
<TradeMsg>
<Activity>New</Activity>
<Status>Submit</Status>
<TransType>Trade</TransType>
<ProductType>CreditDefaultSwapShort</ProductType>
<Submitter>
<partyTradeIdentifier>
<fpml:partyReference href="DTCC0000T720"/>
<fpml:tradeId tradeIdScheme="TradeRefNbr">13155</fpml:tradeId>
</partyTradeIdentifier>
</Submitter>
<BrokerTradeVersion>1</BrokerTradeVersion>
</TradeMsg>
<MsgId>Tullett-737</MsgId>
</Manifest>
<Delivery>
<RouteInfo>
<From>DTCC0000T720</From>
<To>DTCC</To>
</RouteInfo>
<RouteHist>
<Route>
<RouteAddress>www.requestoraddress.com</RouteAddress>
<ReceiveTime>2006-08-21T15:20:59.271-04:00</ReceiveTime>
<ReleaseTime>2006-08-21T15:20:59.271-04:00</ReleaseTime>
</Route>
</RouteHist>
</Delivery>
</OTC_RM>
</env:Header>
<env:Body>
<OTC_Matching xmlns="OTC_Matching_01-Jan-2006">
<Activity>New</Activity>
<Status>Submit</Status>
<Trade>
<FpML xmlns="http://www.fpml.org/2005/FpML-4-2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.fpml.org/2005/FpML-4-2 /xmls/OTC/fpml-main-4-2.xsd
http://www.w3.org/2000/09/xmldsig# /xmls/OTC/xmldsig-core-schema.xsd" xsi:type="RequestTradeConfirmation" version="4-2">
<header>
<messageId messageIdScheme="perFpMLReqmt">Tullett-737</messageId>
<sentBy>DTCC0000T720</sentBy>
<sendTo>DTCC0000T743</sendTo>
<creationTimestamp>2006-08-21T10:25:48.000-04:00</creationTimestamp>
</header>
<trade>
<tradeHeader>
<partyTradeIdentifier>
<partyReference href="DTCC0000T720"/>
<tradeId tradeIdScheme="TradeRefNbr">13155</tradeId>
</partyTradeIdentifier>
<tradeDate>2006-08-21</tradeDate>
</tradeHeader>
<creditDefaultSwap>
<generalTerms>
<effectiveDate>
<unadjustedDate>2006-08-22</unadjustedDate>
<dateAdjustments>
<businessDayConvention>NotApplicable</businessDayConvention>
</dateAdjustments>
</effectiveDate>
<scheduledTerminationDate>
<adjustableDate>
<unadjustedDate>2011-09-20</unadjustedDate>
<dateAdjustments>
<businessDayConvention>NotApplicable</businessDayConvention>
</dateAdjustments>
</adjustableDate>
</scheduledTerminationDate>
<sellerPartyReference href="DTCC0000T743"/>
<buyerPartyReference href="DTCCNON-SUBSCRIBER"/>
<referenceInformation>
<referenceEntity>
<entityName entityNameScheme="www.tullib.com/otcmarker/reference_entity_names">IBM Cr Corp</entityName>
</referenceEntity>
<referenceObligation>
<bond>
<instrumentId instrumentIdScheme="http://www.fpml.org/spec/2002/instrument-id-CUSIP-1-0">44922L5H</instrumentId>
</bond>
</referenceObligation>
</referenceInformation>
</generalTerms>
<feeLeg>
<singlePayment>
<adjustablePaymentDate>
2006-08-22</adjustablePaymentDate>
<fixedAmount>
<currency>
USD</currency>
<amount>
28000.0</amount>
</fixedAmount>
</singlePayment>
<periodicPayment>
<paymentFrequency>
<periodMultiplier>3</periodMultiplier>
<period>M</period>
</paymentFrequency>
<firstPaymentDate>2006-12-20</firstPaymentDate>
<rollConvention>20</rollConvention>
<fixedAmountCalculation>
<fixedRate>0.0043</fixedRate>
</fixedAmountCalculation>
</periodicPayment>
</feeLeg>
<protectionTerms>
<calculationAmount>
<currency>USD</currency>
<amount>5000000</amount>
</calculationAmount>
<creditEvents>
<restructuring/>
</creditEvents>
</protectionTerms>
</creditDefaultSwap>
<documentation>
<brokerConfirmation>
<brokerConfirmationType brokerConfirmationTypeScheme="http://dtcc.com/coding-scheme/broker-confirmation-type">NorthAmericanCorporate</brokerConfirmationType>
</brokerConfirmation>
</documentation>
<tradeSide id="tradeSide1">
<executor>
<party href="DTCC0000T720"/>
</executor>
<creditor>
<party href="DTCC0000T743"/>
</creditor>
</tradeSide>
</trade>
<party id="DTCCNON-SUBSCRIBER">
<partyId partyIdScheme="DTCC">DTCCNON-SUBSCRIBER</partyId>
</party>
<party id="DTCC0000T743">
<partyId partyIdScheme="DTCC">DTCC0000T743</partyId>
</party>
<party id="DTCC0000T720">
<partyId partyIdScheme="DTCC">DTCC0000T720</partyId>
</party>
</FpML>
<PartyExecution>
<partyContactReference href="Contact1_DTCC0000T743"/>
<partyContactReference href="Contact1_DTCC0000T720"/>
<executionMethod>V</executionMethod>
</PartyExecution>
<PartyContact id="Contact1_DTCC0000T743">
<partyReference href="DTCC0000T743"/>
<contactName>QA2_Test_Trader_51500</contactName>
</PartyContact>
<PartyContact id="Contact1_DTCC0000T720">
<partyReference href="DTCC0000T720"/>
<contactName>Cdb1_50283</contactName>
<deskId>1234</deskId>
</PartyContact>
</Trade>
</OTC_Matching>
</env:Body>
</env:Envelope>

Please guide me.

Thanks,
Alok
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2008
Added on Aug 21 2006
2 comments
130 views