Question to Steve - document('somedocument.xml') efficiency.

Hi.
I have a question about how efficient is using external documents in XSLT with Oracle XML parser and XSLT processor. Will somedocument.xml be reloaded every time I access something like document('somedocument.xml')/root/node/whatever?
Will this document be reloaded every time if I use
<xsl:variable name="t" select="document('somedocumentorURL.xml')/root/set"/>
and then use
<xsl:value-of select="$t/node1"/>
<xsl:value-of select="$t/node2"/>
and so on.
Is there some cache for external documents implemented? Or what is the preferred way of accessing information in external documents?
Thank you in advance for the answer.
Bye.

The XSLT 1.0 spec requires a processor to fetch the resource only once per transformation "run" for each distinct URI that you pass to the document() function.

Similar Messages

  • Using XMLDOM to process document in XML DB

    I am new to XML and especially XML DB which I however see as an excellent platform on which to base XML based solutions. I have a specific question and apologise beforehand should any of my assumptions be incorrect.
    I wish to create an application which from a number of XML fragments, together with rules governing the behaviour of the fragments (insertion points, overwrite rules etc) are merged together to finally leave me with a complete and valid XML document in XML DB.
    I thought at first that I could use DBMS_XMLDOM to perform this low level processing required. I have however not managed to understand how this can be used together with XMLDB. I am reluctant to use XMLDOM without XMLDB as I am afraid that I will surpass the limits in XML document size apparently imposed by XMLDOM.
    I see a solution where I create a schema based resource in XML DB containing the initial XML structure and then processing any number of the above mentioned fragments to finaly be left with a complete XML document.
    Can I use XMLDOM to do this or am I barking up the wrong tree?
    I would be grateful for any input on techniques that I can apply to perform elementary search/replace/insert on an XML document which I am, from PLSQL, compiling.
    Thanks
    Hans Christiansen

    Hi
    The size of the documents I want to compose are expected vary from a few Kb to 1 or 2 Gb! In a FAQ found somewhere on OTN there was an entry which mentioned that somebody was having trouble with a 50Mb XML document. The recommendation was to use SAX but I am under the impression that this is more useful when the processing is of a more sequential nature.
    The main thread of my question is to gain clarity in the most suitable technique to use when actualy compsing the XML.
    What I want to do is:
    Create resource (XML document) in XML DB.
    Loop through XML fragments together with rules:
    For each fragment process according to rules and insert
    fragment or update existing XML based on fragment contents.
    At the end of the loop the XML document is complete and ready for further processing.
    XMLDOM seems to give me the tools to do this but I am unsure of how to do this and have XMLDOM work directly against the contents in the resource controlled by XML DB (making use of possible indexes and the scalable nature of XMLDB). I get the feeling that if I simply read the XML from XMLDB resource into a DOM document I am still using the memory based representation of the XML until I write the XML back to XMLDB - is this a correct assumption.
    Alternatively is it the functionality offered by XPath, extract(), updatexml() etc. that I should be looking at?
    Does this make my question more understandable?
    Hans

  • Document in xml - Not serializable? Well, I need to cache it.

    Can anyone tell me how can I serialize DOM Document.
    When we try to put it in cache, cache complains that it
    is not serializable (I believe ElementImpl is not Serializable).
    In javadoc it shows serializable form for this Element, but when I look in the source it does not implements Serializable (and none of its parent interfaces).
    My question is this?
    Does anyone know how to serialize Document.
    (I do need to Serialize Document, not XML.In my case it
    is too expensive to parse XML every time I come back
    from cache)
    How do I use Serializable form of one class or interface?
    Thank You.
    Edmon

    Sorry about not being very helpful earlier. The number of people who submit JDC forum questions without reading even the elementary intro docs is rather staggering, IMHO. Here is something more detailed:
    (a) "Serialized form" of a class as found in javadoc has little to do with whether or not the class has been declared as Serializable by the implementor.
    (b) what matters to Java serialization is whether the object in question is runtime-Serializable. In your particular case, org.w3c.dom.Document is an interface and it was not declared as Serializable by W3C. Perhaps justifiably so, because that imposes unfair requirements on parser implementors [seeing that not everybody is expected to want to serialize a DOM tree the way you do].
    However, a particular parser implementation is free to make its Document implementation class as Serializable. If that is the case, writeObject(obj) will succeed even if "obj" variable is of Document [not Serializable] type but happens to point to a Serializable implementation class.
    But, if you rely on this behavior you are locking yourself into that particular parser implementation. Should you choose a different XML parser in the future you will see serialization errors at runtime. With things like JAXP and a variety of XML parsers available this perhaps is not the way to go.
    Things would have been different if Document was declared to implement Serializable. Then all XML parsers would have had a standard behavior for the DOM trees they produced, regardless of implementation details. This is not the case, though.
    Vlad.

  • No questions, just some ANSWERS about XML

    I'm relatively new to InDesign and XML (though I've done HTML for many years, so XML at least looked familiar to me). I'm trying to automate production of an InDesign document, and ran into several pitfalls along the way. I'm sure there will be more. But I'd like to share my problems and solutions, for anyone else who may be experiencing the same thing(s).
    1) I logically grouped elements using a Parent tag. For example, on the cover page, I have all elements within a "CoverPage" tag which does not reference a physical object. InDesign would not properly import the XML as long as I was using the Parent in this way. After talking it over with Adobe support, we discovered that it worked ONLY if "Clone Repeating Text Elements" is checked--even though I had NO repeating elements. Support said they would report this as a bug.
    2) The documentation implies that to replace a linked image in an InDesign document, you use the form:
    Maybe it's my HTML experience creeping in, but I assumed Image was a defined keyword that had to appear in the XML. In reality, the actual TAG NAME should take the place of the word "Image". For example, the tag name in my document is "CoverPhoto" and the image is a "c:/myphoto.jpg", so the proper syntax is:
    3) I discovered the issue of #2 above, by taking the VERY GOOD suggestion from Support (thanks, Bryce!) of EXPORTING the existing document to XML and seeing how InDesign formats it. Note that it won't add line breaks, but you can still scan through it to see what it's doing. Also be aware that the only things that will export, are things that you have tagged.
    4) I had an issue with imported photos not filling the frame as expected. The original images were fitted to the frames. This issue appears in another question in the Archives, without a suitable answer. The answer is surprisingly simple: instead of Right-clicking the image and choosing your Fitting options, which appears to be a "one-time" application, click the image and in the Object menu, go to Fitting > Frame Fitting Options and choose your fitting. This setting seems (so far at least) to "stick" even with imported XML content.
    I hope this helps someone else out there avoid some of the frustrations that I went through. I have to admit, InDesign is amazing and sweet--but the documentation on XML needs to be a lot better.

    i Sorry, can't find button 'Add Topic'. Have to write here. 8)
    Need to build document with repeated items (companies, contacts, description). This info stored in DB and can be exported in XML the way I need. InDesign CS3.
    Here is the details:
    Each company has name and contacts (address, tel, fax, email and site, BUT some of them may be missed) and may have a description (but may NOT)
    In my doc I want to see smth like that for each company:
    a) paragraph with company name
    b) all contact info in separated paragraphs
    c) description paragraph
    Trouble is that I get unnecessary line breaks in places where some contact info or description are missed.
    Can anyone help? Sorry for my english 8)

  • Document in xml - Not serializable?

    Hi, I was working with the Document in xml.
    I tried to serialize it, but it seems that the implemantation of it is not serializable.
    The problem is that the object is created with a factory method, so also inheriting it is no use, since the creation is not in our hands.
    The only solution i can see is to inherit also the Factory and to ovverde the creation method.
    Any suggestion?
    Thanks,
    Doron

    why do you want to serialize the document object?
    you might as well serialize the xml file it represents and when or where needed, just parse it and get its document object, which would essentially be the same as the object you are trying to serialize.

  • XML Document from XML Schema Bug

    When an XML document is generated from an XML Schema the XML document does not have all the elements specified in the XML Schema. The XML document only has the root element.
    1. Register an XML Schema.
    2. Create an XML document with File>New>General>XML>XML Document from XML Schema. The "Generate only Required Elements" is unchecked.
    3. The XML document has only the root element.
    In JDeveloper 10.1.3 all the elements in the XML Schema get generated.

    Also, the component palette for the XML document generated from the XML Schema does not list all the elements in the XML Schema, only the root element is listed. Even if elements are specified as required in the XML Schema with minOccurs="1" and the "Generate only Required Elements" checkbox is selected only the root element gets generated.

  • Document on XML date rules and date management

    Hi,
    Could you Please send a document on XML date rules and date management. I really in need of it. You may send it to [email protected]

    Hello
    Could you please email this to me:  [email protected]
    Thanks in advance
    Kevin

  • XSLT Using document() reference XML DB object

    I have two XML structured documents loaded in XML DB, and I use transform on x1.xml with a style sheet that contains :
    <xsl:apply-templates select="document('x2.xml')"/>
    what's the best way to reference the x2.xml found in the database using the document function of the XSL ... can this be done?

    In theory you'll need to create a resource (repository object) that references x2.xml and then refer to it by it's path from the root of the repository

  • Generating document in XML in RM

    Hi,
    I have a function module where I create a document in XML and store it in RM.
    In the code of this funcion module, I first create the empty document using the FM SRM_DOCUMENT_CREATE, and then I add the content to this document with the FM SRM_DOCUMENT_CHECKIN_VIA_TAB.
    This has always worked in a 6.40 release. But now I have this same funcion module in a 6.20 release and it does not work properly. The document is generated correctly, but the content is not properly displayed. It has the spanish special characters (such as 'ñ', '´') replaced with rare characters. For example, instead of displaying "DISEÑO", it displays "DISEñO".
    I have no idea what the problem can be, I guess it has something to do with the codepage. But I can't find the solution.
    I have tried using the function module SCP_TRANSLATE_CHARS, but I don't know if I am using it correctly becuase it makes no change and does not replace the incorrect characters.
    Thanks in advance,
    Nerea.

    why do you want to serialize the document object?
    you might as well serialize the xml file it represents and when or where needed, just parse it and get its document object, which would essentially be the same as the object you are trying to serialize.

  • Using "XML Document from XML Schema" in JDeveloper

    Hi Experts,
    I have a requirement to generate XML Document from XML Schema.
    For this I have used "XML Document from XML Schema" feature in JDeveloper. It is found in File->New->General->XML Document form XML Schema.
    I have registered a schema with jdev and got an XML document output for that successfully.
    Now, I want to implement this feature in my code for generating XML documents when XSD files are provided.
    Can any one please provide me with pointers to do that? I am sure there should be some libraries which can implement this feature.
    Thanks,
    Dilbagh

    Create an XML document from a Schema with the Oracle SchemaClassGenerator.
    import oracle.xml.classgen.SchemaClassGenerator;
    XMLSchema schema=new XMLSchema();
    XSDBuilder builder = new XSDBuilder();
    URL    url =  new URL(schemaUrl);     
    schema = (XMLSchema)builder.build(url);
    SchemaClassGenerator generator = new SchemaClassGenerator();
    Generate the Java classes from the example XML Schema.
    generator.generate(schema);With the java classes construct an XML document.

  • Where can i get good documents for XML

    Hai,
    I am new to XML..I like to know where can i get good documents for XML that can be downloaded.
    regards,
    Mathan
    null

    You can order online from here and here.
    Regards,
    -rh

  • Exporting web analysis document in .xml format

    Can anyone please let me how to export the web analysis document in .xml format

    Hi,
    I think you can only export WA documents/presentations in apt, ard or *arg files, not in XML.
    Kind regards
    André

  • Got error message when store XML documents into XML DB repository, via WebD

    Hi experts,
    I am in I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    I got error message when store XML documents into XML DB repository, via WebDAV.
    I have successfully registered 5 related schemas and generated 1 table.
    I have inserted 40 .xml files into this auto generated table.
    using these data I created relational view successfully.
    but since I couldn't store XML documents into XML DB repository, via WebDAV
    when I query using below code:
    SELECT rv.res.getClobVal()
    FROM resource_view rv
    WHERE rv.any_path = '/home/DEV/messages/4fe1-865d-da0db9212f34.xml';
    I got nothing.
    My ftp code is listed below:
    ftp> open localhost 2100
    Connected to I0025B368E2F9.
    220- C0025B368E2F9
    Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
    220 I0025B368E2F9 FTP Server (Oracle XML DB/Oracle Database) ready.
    User (I0025B368E2F9:(none)): fda_xml
    331 pass required for FDA_XML
    Password:
    230 FDA_XML logged in
    ftp> cd /home/DEV/message
    250 CWD Command successful
    ftp> pwd
    257 "/home/DEV/message" is current directory.
    ftp> ls -la
    200 PORT Command successful
    150 ASCII Data Connection
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 .
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 ..
    226 ASCII Transfer Complete
    ftp: 115 bytes received in 0.00Seconds 115000.00Kbytes/sec.
    250 SET_CHARSET Command Successful
    ftp> put C:\ED\SPL\E_Reon_Data\loaded\4fe1-865d-da0db9212f34.xml
    200 PORT Command successful
    150 ASCII Data Connection
    550- Error Response
    ORA-00600: internal error code, arguments: [qmxConvUnkType], [], [], [], [], [], [], [], [], [], [], []
    550 End Error Response
    ftp: 3394 bytes sent in 0.00Seconds 3394000.00Kbytes/sec.
    I have tried all suggestion from another thread such as:
    alter system set events ='31150 trace name context forever, level 0x4000'
    SQL> alter system set shared_servers = 1;
    but failed.
    is there anyone can help?
    Thanks.
    Edited by: Cow on Mar 29, 2011 12:58 AM

    Hi experts,
    I am in I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    I got error message when store XML documents into XML DB repository, via WebDAV.
    I have successfully registered 5 related schemas and generated 1 table.
    I have inserted 40 .xml files into this auto generated table.
    using these data I created relational view successfully.
    but since I couldn't store XML documents into XML DB repository, via WebDAV
    when I query using below code:
    SELECT rv.res.getClobVal()
    FROM resource_view rv
    WHERE rv.any_path = '/home/DEV/messages/4fe1-865d-da0db9212f34.xml';
    I got nothing.
    My ftp code is listed below:
    ftp> open localhost 2100
    Connected to I0025B368E2F9.
    220- C0025B368E2F9
    Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
    220 I0025B368E2F9 FTP Server (Oracle XML DB/Oracle Database) ready.
    User (I0025B368E2F9:(none)): fda_xml
    331 pass required for FDA_XML
    Password:
    230 FDA_XML logged in
    ftp> cd /home/DEV/message
    250 CWD Command successful
    ftp> pwd
    257 "/home/DEV/message" is current directory.
    ftp> ls -la
    200 PORT Command successful
    150 ASCII Data Connection
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 .
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 ..
    226 ASCII Transfer Complete
    ftp: 115 bytes received in 0.00Seconds 115000.00Kbytes/sec.
    250 SET_CHARSET Command Successful
    ftp> put C:\ED\SPL\E_Reon_Data\loaded\4fe1-865d-da0db9212f34.xml
    200 PORT Command successful
    150 ASCII Data Connection
    550- Error Response
    ORA-00600: internal error code, arguments: [qmxConvUnkType], [], [], [], [], [], [], [], [], [], [], []
    550 End Error Response
    ftp: 3394 bytes sent in 0.00Seconds 3394000.00Kbytes/sec.
    I have tried all suggestion from another thread such as:
    alter system set events ='31150 trace name context forever, level 0x4000'
    SQL> alter system set shared_servers = 1;
    but failed.
    is there anyone can help?
    Thanks.
    Edited by: Cow on Mar 29, 2011 12:58 AM

  • Question about Java,XSLT and XML

    I am new to Java and XML. I'm not quite clear the relationship between Java,XSLT and XML.
    To exercise, I am going to write a Java program that makes embedded calls to an XSLT processor(XALAN), to produce results for several constrained transformations from a given XML document(x.xml) such as:
    1.Transform the x.xml (which satisfies d1.dtd) in such a way that it now conforms to the DTD d2.dtd. Output the resulting xx.xml document.
    2.query some information from the x.xml and then form an Html output.
    3.summary some information, do some statistics from the x.xml and then form an Html output.
    I don't konw which java classes and XSLT functions might be used.(Actually I don't know how/where to start).
    Can anyone give me some clue ?
    thanks a lot!

    You must provide XSLT stylesheeds to specify transformations (1), (2),
    and (3); let's call those stylesheets task1.xsl and so on.
    The following code will transform x.xml into xx.xml according to task1.xsl. It gives you an idea which packages and classes to use, but it doesn't teach you proper Java programming technics :)
    import java.io.File;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    public class Test
        public static void main(String[] args) throws Exception
            TransformerFactory factory = TransformerFactory.newInstance();
            Source config = new StreamSource(new File("task1.xsl"));
            Transformer transformer = factory.newTransformer(config);
            Source source = new StreamSource(new File("x.xml"));
            Result result = new StreamResult(new File("xx.xml"));
            transformer.transform(source, result);
    }To read about XSLT, see:
    http://www.w3.org/TR/xslt
    there is a tutorial on using XSLT with Java:
    http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/xslt/index.html.

  • How to convert XML document to xml variable?

    Hi,
    I have taken an xml variable in my process and reading a xml document file. Can anyone tell me how can i convert this xml document to xml variable so that i can parse the xml variable.
    I am able to convert xml variable to xml document variable by using set value activity. But how do I perform reverse process.
    I want to perform this conversion because i want to keep xml data in document format on storage drive and then parse this xml data so that i can read the nodes.
    Any help will be appreciated..
    Regards
    Sunil

    we can use set value activity to reach these xml docs and assign it to xml variable.
    Then parsing of this xml can be browsed to find the nodes.
    Regards
    Sunil

Maybe you are looking for