How can (parse) i use XML file with missing EndTag
hi,
i have an application which writes an "XML file".
another application should read that XML file, build an DOM and
access the nodes with xpath.
my problem. if the first application is not finished there are tags
missing. e.g. </xml>. but the seconds application cannot wait until the first application finishes it task.
if i now read the XML file the parser cannot load it because the end tags are missing.
my question:
how can i deactivate the check or how can i read the XML file and access it via XPath (my application is using at the moment XPath to access the nodes and i dont want to change that)
as parser i am using XERCES
alex
As far as I know, you can't do this - xml must be well formed (this is sort of a bedrock of xml). There may be some work around's, but I'm not aware of any - and they would most likely be hacks.
Similar Messages
-
How can i write a XML file with oracle data ?
How can i write a XML file using PL/SQL.
Can i do as follows.
1.Open a file using UTL_FILE.FOPEN(LC_DIR_LOC,'abc.xml','W') ;
2.write all the required tag and value using UTL.put_line
that is enough. Is not, please guide me to write.
gkHaving Oracle 9i.
One more doubt. In the speck, some constand values are there, When i write the same into file, How can i write ?.
1. l_str := ' "E27" '
or
2. l_str := ' E27 '
UTL_FILE.PUT_LINE(L_FILE_POI,l_str,TRUE);
1 case : in XML file : "E27"
In 2 case : E27
When we write a XML file through editors , we have to define the constant within quote . is it?
Which one can i use ? Or any other way is there ..
Thanks and Regards
gopi -
How can I save a XML file with JAXP1.1?
Dear All.
I write a program to create XML file with DOM model, but I can't know how to save it? My environment is JAXP1.1 and JDK1.3.1,I has been required not use other XML parser toolkits,only JAXP1.1.
How can I do? thank you.
Many person give me a idea the com.sun.xml.tree.XmlDocument, but I can't find the class in API document or JAXP1.1's packages. why?
what is it? How can i use it?
thank you very much.The way to save an XML Document is using a Transformer.
To have access to a transformer use the packages :
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
Then for saving your Document Object (named dXml) get a Transformer Object with the TransformerFactory Object :
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer();
Now you have got your Transformer Object, to save your Document Object use the method :
Document dXml = getMyDocument(); // this is your Document Object.
OutputStream osSave = getMySaveStream(); // this the OutputStream you need to save your Document.
try
t.transform(new DomSource(dXml), new StreamResult(new OutputStreamWriter(osSave)));
finally
osSave.close();
And your Document was now saved. -
How to extract data from XML file with JavaScript
HI All
I am new to this group.
Can anybody help me regarding XML.
I want to know How to extract data from XML file with JavaScript.
And also how to use API for XML
regards
NagarajuThis is a Java forum.
JavaScript is something entirely different than Java, even though the names are similar.
Try another website with forums about JavaScript.
For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3 -
How to parse contents from XML file in Java
Hi All,
I have a scenario like this . I have one xml file with key value pairs of ( name , URL ) . I have retrieved contents from XML file , now I want to parse these contents and store in a bean object.
How to parse Contents of XML file??
Thanks in advance,
Rajendra.Hi All,
I have a scenario like this . I have one xml file with key value pairs of ( name , URL ) . I have retrieved contents from XML file , now I want to parse these contents and store in a bean object.
How to parse Contents of XML file??
Thanks in advance,
Rajendra. -
How can I pass a xml file to the webservice?
Hello friends,
How can I pass the XML file to any webservice API ?
I have all the inputs of API in to the XML file.
Please note:- I don't intend to do any .NET or Java coding to populate the data in the objects .Instead I plan to input the data to the webservice direcly from the XML file required schema.
If necessary I can use Oracle Bpel process manager for it.
Thanks and regards
Ram Krishna Tripathi
[email protected]Well, I've used it (or rather: tried it); did not/could not find the many options to export at a nearly lossless conversion for HD footage (hence my disclaimer "don't know"). Here is a screenshot of the Handbrake options:
And here are the choices and settings from MPEG Streamclip:
Maybe not empirical, but enough for me to have an opinion. -
How can I automatically create the files with serie-name?
Hello, Everyone,
I have a question again.
How can I automatically create the file with a serie-filename?
e.g. I have a program, it will repeat 5 times, and every time it will create a bmp-file, and I want to let this program automatically save these 5 files with a Serie-filename like File001.bmp, File002.bmp, .... File005.bmp.
How can I do it?`
Thanks a lot.
Regarts,
JohnnyHi Deepu,
one more comment
The format code should be "%04d" to get leading zeros and have filenames with same length...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
How can I open a cpr- file with snow leopard ?
How can I open a " cpr " file with my Mac OS X 10.6.8. ?
Thank you for your fast reply ! The recommended software referes to video data. I received the cpr file from the ALDI fotobook software, if a want to secure a footobook layout. Therefor cpr must be a foto file.
-
How to parse the following xml file
Hi
I have an xml file with the following data
Example.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<html><set label="09/07/29" value="1241.90"/>
</html>
How do i retrive the values of the attributes
Example i want the label value 09/07/29
and 1241.90 to be inserted into some temp table.
Appreciate if any one can provide me the solution.
Thanks,it's more an XQuery question than DB XML one.
Anyway, you can use the following queries to get attributes values:
doc(<your_doc>)/html/set/@label
doc(<your_doc>)/html/set/@valueYou can retrieve both values in a single query, but for this please refer to the XQuery specification.
Or read: [http://www.oracle.com/technology/documentation/berkeley-db/xml/gsg_xml/java/xquery.html#xqueryintro]
Best,
Vyacheslav -
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); -
How can I create a exe file with a tab control on it that work´s ?
I have a VI with many controls and indicators,these are spread on a tab control.This tab control works with out any problems but if i create a exe file then the tab control is fixed. How can I create a exe file so that the tab control on it work´s ?
I have made a new Posting with the same question but this time I added a screenshot of the VI.
Attachments:
project7.1.jpg 129 KB -
Loading XML file with missing elements dynamically through ODI
Hi Guys ,
I have the below xml file with two nodes Employee and Address. On a daily basis , sometimes the address element might not come in from the source xml file , but my interface has columns mapped to address elements, and hence it can fail due to the source element not being found in the file or data might not get loaded due to the 'and' condition in the sql query generated between the employee and address elements. Is there a way where i can load the data dynamically where i can search in the file only for the elements (Employee) present and load data only for those elements dynamically?
XML File:
<?xml version="1.0" encoding="UTF-8" ?>
<EMP>
<Empsch>
<Employee>
<EmployeeID>12345</EmployeeID>
<Initials>t</Initials>
<LastName>john</LastName>
<FirstName>doe</FirstName>
</Employee>
<Address>
<WorkPhone>12345</WorkPhone>
<WorkAddress>Test 234</WorkAddress>
</Address>
</Empsch>
</EMP>
Thanks ,
Revanth TambisettyI was able to resolve it by using left outer joins and referring the table structure from the XSD
-
How can I skip the XML file's space & "\n" when using a DOM?
This is my xml file below:
<?xml version="1.0" encoding="UTF-8"?>
<inventory>
<item>
<sku>3965</sku>
<describtion>widget</describtion>
<quality>108</quality>
</item>
<item>
<sku>5478</sku>
<describtion>gadget</describtion>
<quality>101</quality>
</item>
<item>
<sku>4575</sku>
<describtion>sprocket</describtion>
<quality>106</quality>
</item>
</inventory>between the <inventory> and the<item>,there is one "\n" and tow "space" ,
then between the <item> and the <sku>,there is ...
on and on...
and this is my java code:
import javax.xml.parsers.*;
import org.w3c.dom.*;
public class DomDemo {
DocumentBuilderFactory dbf = null;
DocumentBuilder df = null;
Document doc = null;
public DomDemo() {
try {
dbf = DocumentBuilderFactory.newInstance();
dbf.setIgnoringElementContentWhitespace(true);
catch(FactoryConfigurationError fce) {
fce.printStackTrace();
try {
df = dbf.newDocumentBuilder();
catch(ParserConfigurationException pce) {
pce.printStackTrace();
public void printXML(Node node) {
short nodeTypeValue;
String nodeType = null;
Node currentNode = null;
nodeTypeValue = node.getNodeType();
nodeType = getNodeType(nodeTypeValue);
System.out.println("NodeType:" + nodeType);
System.out.println("NodeName:" + node.getNodeName());
System.out.println("NodeValue:" + node.getNodeValue());
for(currentNode = node.getFirstChild(); currentNode != null; currentNode = currentNode.getNextSibling()) {
printXML(currentNode);
public String getNodeType(short nodeTypeValue) {
String nodeType = null;
switch(nodeTypeValue) {
case Node.DOCUMENT_NODE:
nodeType = "DocumentNode";
break;
case Node.ELEMENT_NODE:
nodeType = "ElementNode";
break;
case Node.ATTRIBUTE_NODE:
nodeType = "AttributeNode";
break;
case Node.TEXT_NODE:
nodeType = "TextNode";
break;
default:
nodeType = "OtherNode";
return nodeType;
public static void main(String[] args) {
if(args.length == 0) {
System.out.println("Usage:java DomDemo filename");
System.exit(1);
String file = args[0];
DomDemo dd = new DomDemo();
Document doc = null;
try {
doc = dd.df.parse(file);
catch(Exception e) {
e.printStackTrace();
dd.printXML(doc);
}when run the class, the result is below:
NodeType:DocumentNode
NodeName:#document
NodeValue:null
NodeType:ElementNode
NodeName:inventory
NodeValue:null
NodeType:TextNode
NodeName:#text
NodeValue:
NodeType:ElementNode
NodeName:item
NodeValue:null
NodeType:TextNode
NodeName:#text
NodeValue:
It contains a TextNode and its value is " " and a "\n".
I used setIgnoringElementContentWhitespace feature, but it seems didn't work.
How can i solve it?I used setIgnoringElementContentWhitespace feature, but it seems didn't work.
Add a DTD to the XML document for setIgnoringElementContentWhitespace feature. -
Hi,
I have a problem to transfer a XML file content to a MS SQL database by a given/fixed stored procedure. I'm able to transfer the content of the file by using following method ...
hstmt = DBPrepareSQL (hdbc, EXEC usp_InsertReport '<Report> ..... </Report>');
resCode = DBExecutePreparedSQL (hstmt);
resCode = DBClosePreparedSQL (hstmt);
... but in this case I'm not able to fetch the return value of the stored procedure!
I have tried to follow the example of the stored procedure in the help documentation (DBPrepareSQL) but I miss a datatype for xml?!?
Any idea how to solve my problem?
KR Cake
Solved!
Go to Solution.After some additional trials I found a solution by calling the stored procedure in this way
DBSetAttributeDefault (hdbc, ATTR_DB_COMMAND_TYPE, DB_COMMAND_STORED_PROC);
DBPrepareSQL (hdbc, "usp_InsertReport");
DBCreateParamInt (hstmt, "", DB_PARAM_RETURN_VALUE, -1);
DBCreateParamChar (hstmt, "XMLCONTENT", DB_PARAM_INPUT, sz_Buffer, (int) strlen(sz_Buffer) + 1 );
DBExecutePreparedSQL (hstmt);
DBClosePreparedSQL (hstmt);
DBGetParamInt (hstmt, 1, &s32_TestId);
where sz_Buffer is my xml file content and s32_TestID the return value of the stored procdure (usp_InsertReport(@XMLCONTENT XML))
Now I face the problem, that DBCreateParamChar limits the buffer size to 8000 Bytes.
Any idea to by-pass this shortage?? -
How can i generate session.xml file?
hello
i am a beginner of toplink,i find that in my project,i must provide two xml format files,they are "session.xml" and a project xml file,to make the toplink works well,the project descriptor can be generated by using the mapping workbench,but how can i generate the "session.xml",now,what i can do is to modify the sample file that come with the toplink installation,i wonder if there is a graphic tool that can be used to generate it?
thanks for any helps!Currently there is no UI support for creating or modifying sessions.xml. The DTD is provided in both the documentation as well as in the installed files (<TOPLINK_HOME>\core\sessions_4_5.dtd). The examples should also contain a variety of sessions.xml file to assist you.
Doug Clarke
Principal Product Manager, Oracle9iAS TopLink
Oracle Corporation
Maybe you are looking for
-
Prior till about 24 hours ago, I was able to preview an item that I listed on ebay without any problems. Now I cannot preview the item in Firefox, but I can preview the item in internet explorer. What might be causing this? Thanks,
-
Field name not known in old existing report.
We have a report that we have used for a long time and has always been fine. Today when we open it it says data will be lost because "Field name not known". So you click ok and look at the report in design and the report is missing a bunch of fie
-
Hi Friends I have a COPA extract structure created where in i am using the delta update. When i tried to do the extraction some how the data is not being extracted into SAP BW . Now where should i collect the time stamp and what is the process that i
-
Dear All , I m display a material in MM03 , But an error thrown by system as below "The material XXXXXXX does not exist or is not activated Message no. M3305 " Can ne one
-
hi experts .. i has a query of how to do interactive reporting in alv,s what are the function modules i can use to attain interactiveness. .? Regards, sujatha