PL/SQL XML to Object Type with Attributes and text()Text editor to open big (giant, huge, large) text filesWhat characters do I need to escape in XML documents?Deserializing empty xml attribute value into nullable int property using XmlSerializerHow do I parse XML in Python?How do I comment out a block of tags in XML?What does <![CDATA[]]> in XML mean?How do you parse and process HTML/XML in PHP?How to serialize/deserialize optional XML enumeration in C#?specify attributes on a nil xml elementXML array with custom attribute and element names

Is it damaging to turn off a small fridge for two days every week?

Is my Rep in Stack-Exchange Form?

Can the negators "jamais, rien, personne, plus, ni, aucun" be used in a single sentence?

Does Marvel have an equivalent of the Green Lantern?

Is there any set of 2-6 notes that doesn't have a chord name?

Is there a maximum distance from a planet that a moon can orbit?

ては's role in this 「追いかけては来ないでしょう」

Why is the voltage measurement of this circuit different when the switch is on?

Impossible darts scores

Should I tell my insurance company I'm making payments on my new car?

Unusual mail headers, evidence of an attempted attack. Have I been pwned?

What do you call a weak person's act of taking on bigger opponents?

Going to get married soon, should I do it on Dec 31 or Jan 1?

Catching generic Exception in a toString implementation - bad practice?

Can ADFS connect to other SSO services?

What kind of wire should I use to pigtail an outlet?

First-year PhD giving a talk among well-established researchers in the field

What sort of mathematical problems are there in AI that people are working on?

How to perform Login Authentication at the client-side?

Did Karl Marx ever use any example that involved cotton and dollars to illustrate the way capital and surplus value were generated?

Low-gravity Bronze Age fortifications

Can’t attend PhD conferences

Require advice on power conservation for backpacking trip

Story-based adventure with functions and relationships



PL/SQL XML to Object Type with Attributes and text()


Text editor to open big (giant, huge, large) text filesWhat characters do I need to escape in XML documents?Deserializing empty xml attribute value into nullable int property using XmlSerializerHow do I parse XML in Python?How do I comment out a block of tags in XML?What does <![CDATA[]]> in XML mean?How do you parse and process HTML/XML in PHP?How to serialize/deserialize optional XML enumeration in C#?specify attributes on a nil xml elementXML array with custom attribute and element names






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I want to deserialize the following XML structure into an PL/SQL Object Type:



<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute">Hello</Station>
</ProcessingInfo>


What is special in this XML: The element <Station> has an attribute SerialNumber and the actual text() value Hello.



How do the types must be defined to deserialize the XML into a object types?



For the XML structure I have defined the following types:



CREATE OR REPLACE TYPE station_t FORCE AS OBJECT (
"@SerialNumber" VARCHAR2(100 CHAR)
);


CREATE OR REPLACE TYPE processingInfo_t FORCE AS OBJECT (
"MrwNumber" VARCHAR2(255)
, "Station" station_t
);


This is my execution logic:



DECLARE
l_obj processingInfo_t;
l_xml XMLTYPE;
BEGIN
l_xml := xmltype(
'<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute">Hello</Station>
</ProcessingInfo>');

l_xml.toObject(l_obj);
END;


And the error:



ORA-19031: XML element or attribute text does not match any in type DEMOGRAPHIC.STATION_T
ORA-06512: at "SYS.XMLTYPE", line 196
ORA-06512: at line 11
19031. 00000 - "XML element or attribute %s does not match any in type %s.%s"
*Cause: The passed in XML tag does not match any in the object type
*Action: Pass a valid canonical XML that can map to the given object type


I know that there is something missing in the station_tobject, since the actual text() will be provided but it is not defined in the type. But I do figure it out.



Another question is, how can I access the attribute value when the serialization happend successfully on object level?



Additional: When I remove the text() = Hello from <Station>, the serialization seems to work:



DECLARE
l_obj processingInfo_t;
l_xml XMLTYPE;
BEGIN
l_xml := xmltype(
'<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute"></Station>
</ProcessingInfo>');

l_xml.toObject(l_obj);
END;









share|improve this question






















  • Ok to access the attribute SerialNumber working with the following call: DBMS_OUTPUT.PUT_LINE(l_obj."MrwNumber"); DBMS_OUTPUT.PUT_LINE(l_obj."Station"."@SerialNumber");

    – Adam Lukaszewski
    Mar 25 at 10:43


















2















I want to deserialize the following XML structure into an PL/SQL Object Type:



<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute">Hello</Station>
</ProcessingInfo>


What is special in this XML: The element <Station> has an attribute SerialNumber and the actual text() value Hello.



How do the types must be defined to deserialize the XML into a object types?



For the XML structure I have defined the following types:



CREATE OR REPLACE TYPE station_t FORCE AS OBJECT (
"@SerialNumber" VARCHAR2(100 CHAR)
);


CREATE OR REPLACE TYPE processingInfo_t FORCE AS OBJECT (
"MrwNumber" VARCHAR2(255)
, "Station" station_t
);


This is my execution logic:



DECLARE
l_obj processingInfo_t;
l_xml XMLTYPE;
BEGIN
l_xml := xmltype(
'<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute">Hello</Station>
</ProcessingInfo>');

l_xml.toObject(l_obj);
END;


And the error:



ORA-19031: XML element or attribute text does not match any in type DEMOGRAPHIC.STATION_T
ORA-06512: at "SYS.XMLTYPE", line 196
ORA-06512: at line 11
19031. 00000 - "XML element or attribute %s does not match any in type %s.%s"
*Cause: The passed in XML tag does not match any in the object type
*Action: Pass a valid canonical XML that can map to the given object type


I know that there is something missing in the station_tobject, since the actual text() will be provided but it is not defined in the type. But I do figure it out.



Another question is, how can I access the attribute value when the serialization happend successfully on object level?



Additional: When I remove the text() = Hello from <Station>, the serialization seems to work:



DECLARE
l_obj processingInfo_t;
l_xml XMLTYPE;
BEGIN
l_xml := xmltype(
'<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute"></Station>
</ProcessingInfo>');

l_xml.toObject(l_obj);
END;









share|improve this question






















  • Ok to access the attribute SerialNumber working with the following call: DBMS_OUTPUT.PUT_LINE(l_obj."MrwNumber"); DBMS_OUTPUT.PUT_LINE(l_obj."Station"."@SerialNumber");

    – Adam Lukaszewski
    Mar 25 at 10:43














2












2








2


1






I want to deserialize the following XML structure into an PL/SQL Object Type:



<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute">Hello</Station>
</ProcessingInfo>


What is special in this XML: The element <Station> has an attribute SerialNumber and the actual text() value Hello.



How do the types must be defined to deserialize the XML into a object types?



For the XML structure I have defined the following types:



CREATE OR REPLACE TYPE station_t FORCE AS OBJECT (
"@SerialNumber" VARCHAR2(100 CHAR)
);


CREATE OR REPLACE TYPE processingInfo_t FORCE AS OBJECT (
"MrwNumber" VARCHAR2(255)
, "Station" station_t
);


This is my execution logic:



DECLARE
l_obj processingInfo_t;
l_xml XMLTYPE;
BEGIN
l_xml := xmltype(
'<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute">Hello</Station>
</ProcessingInfo>');

l_xml.toObject(l_obj);
END;


And the error:



ORA-19031: XML element or attribute text does not match any in type DEMOGRAPHIC.STATION_T
ORA-06512: at "SYS.XMLTYPE", line 196
ORA-06512: at line 11
19031. 00000 - "XML element or attribute %s does not match any in type %s.%s"
*Cause: The passed in XML tag does not match any in the object type
*Action: Pass a valid canonical XML that can map to the given object type


I know that there is something missing in the station_tobject, since the actual text() will be provided but it is not defined in the type. But I do figure it out.



Another question is, how can I access the attribute value when the serialization happend successfully on object level?



Additional: When I remove the text() = Hello from <Station>, the serialization seems to work:



DECLARE
l_obj processingInfo_t;
l_xml XMLTYPE;
BEGIN
l_xml := xmltype(
'<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute"></Station>
</ProcessingInfo>');

l_xml.toObject(l_obj);
END;









share|improve this question














I want to deserialize the following XML structure into an PL/SQL Object Type:



<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute">Hello</Station>
</ProcessingInfo>


What is special in this XML: The element <Station> has an attribute SerialNumber and the actual text() value Hello.



How do the types must be defined to deserialize the XML into a object types?



For the XML structure I have defined the following types:



CREATE OR REPLACE TYPE station_t FORCE AS OBJECT (
"@SerialNumber" VARCHAR2(100 CHAR)
);


CREATE OR REPLACE TYPE processingInfo_t FORCE AS OBJECT (
"MrwNumber" VARCHAR2(255)
, "Station" station_t
);


This is my execution logic:



DECLARE
l_obj processingInfo_t;
l_xml XMLTYPE;
BEGIN
l_xml := xmltype(
'<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute">Hello</Station>
</ProcessingInfo>');

l_xml.toObject(l_obj);
END;


And the error:



ORA-19031: XML element or attribute text does not match any in type DEMOGRAPHIC.STATION_T
ORA-06512: at "SYS.XMLTYPE", line 196
ORA-06512: at line 11
19031. 00000 - "XML element or attribute %s does not match any in type %s.%s"
*Cause: The passed in XML tag does not match any in the object type
*Action: Pass a valid canonical XML that can map to the given object type


I know that there is something missing in the station_tobject, since the actual text() will be provided but it is not defined in the type. But I do figure it out.



Another question is, how can I access the attribute value when the serialization happend successfully on object level?



Additional: When I remove the text() = Hello from <Station>, the serialization seems to work:



DECLARE
l_obj processingInfo_t;
l_xml XMLTYPE;
BEGIN
l_xml := xmltype(
'<ProcessingInfo>
<MrwNumber>000001</MrwNumber>
<Station SerialNumber="nice-Attribute"></Station>
</ProcessingInfo>');

l_xml.toObject(l_obj);
END;






xml oracle plsql






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 10:29









Adam LukaszewskiAdam Lukaszewski

111 bronze badge




111 bronze badge












  • Ok to access the attribute SerialNumber working with the following call: DBMS_OUTPUT.PUT_LINE(l_obj."MrwNumber"); DBMS_OUTPUT.PUT_LINE(l_obj."Station"."@SerialNumber");

    – Adam Lukaszewski
    Mar 25 at 10:43


















  • Ok to access the attribute SerialNumber working with the following call: DBMS_OUTPUT.PUT_LINE(l_obj."MrwNumber"); DBMS_OUTPUT.PUT_LINE(l_obj."Station"."@SerialNumber");

    – Adam Lukaszewski
    Mar 25 at 10:43

















Ok to access the attribute SerialNumber working with the following call: DBMS_OUTPUT.PUT_LINE(l_obj."MrwNumber"); DBMS_OUTPUT.PUT_LINE(l_obj."Station"."@SerialNumber");

– Adam Lukaszewski
Mar 25 at 10:43






Ok to access the attribute SerialNumber working with the following call: DBMS_OUTPUT.PUT_LINE(l_obj."MrwNumber"); DBMS_OUTPUT.PUT_LINE(l_obj."Station"."@SerialNumber");

– Adam Lukaszewski
Mar 25 at 10:43













0






active

oldest

votes














Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55335752%2fpl-sql-xml-to-object-type-with-attributes-and-text%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55335752%2fpl-sql-xml-to-object-type-with-attributes-and-text%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript