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

Similar Messages

  • XSLT, using document() to fetch a local JSP generated XML file

    All,
    I have 1 XML document that keeps track of various subsite owners of a domain I manage. The xml file doesn't hold much, something along the lines of:
    <?xml version="1.0"?>
    <sitedirectory>
         <page id="/marys_page" name="Mary's Page"">
              <content_contact ntid="smithm" />
              <technical_contact ntid="techguy" />
         </page>
    </sitedirectory>Now I also have a JSP page, that when given an NT id as a URL parameter, rifles through LDAP and spits out an xml document with all the relavent ISID fields for that person's id (first name, last name, phone number, e-mail address etc).
    I use the document() function in an XSL file to access that dynamic JSP page, fetch the contents of the resulting XML file. Using the document() function with just a regular file call like "getldap.jsp" only feeds my stylesheet the source of that JSP file, not the resulting XML file that I'm looking for when it's been processed.
    So... I have my document() function calling the full URL to that JSP file on my domain, an example <value-of /> call in my XSL file would be:
    <xsl:value-of select="document('http://my.domain.com/jsp_util/ldap_person.jsp?ntid=smithm')/person/firstname" />and I get what I want, that person's first name, drawn from LDAP into my XSL file. But it seems a little weird to me, having a server-side transformation, accessing a JSP file by making an http call to the same server the transformation resides in.
    Am I missing something? Is there a better way to do this or some directive I'm missing? I'd appreciate any help.

    That's a creative but perfectly reasonable way to use the document() function.
    There are other ways to solve the problem, such as including Java calls in your XSL and applying a customized URIResolver to your transformation, but my approach would be to use the simplest method that works acceptably. So if you don't have performance problems with your solution, I would leave it alone.

  • Use document() function in xslt

    Hi I want to use the xslt function document() to import a data file into the transformation.
    However I don't seem to be able to import the xml file onto the osb. can this be done ?
    Basically can you use the document() function?
    I've tried googling and searching the docs but i think i'm missing something basic :-)
    Thanks in advance

    Not an answer to the particular point but i've got round the issue by adding a stage which inserts the data xml into the xml document being transformed.
    I then supress the data injected from being copied to the output tree and use a variable which references the data nodes rather than a variable referencing
    an external doc variable name="myvar" select="//injecteddatanode" /> rather than <variable name="myvar" select="document("path/doc.xml")
    The question still stands though : how do you import an xml doc which can then be used by the document function in a transform

  • Using XSDBuilder to build XML Schema objects

    I want to parse an XML document using an XML Schema Definition that I provide explicitly to the parser, rather than one identified in the document being validated. It appears that I can create an XML Schema object using XSDBuilder, and give it to the XML parser using XMLParser.setXMLSchema(). The problem is that XSDBuilder.build() wants an XSD system ID that is a file, and I want to retrieve XSD documents from non-file-based stores. Ideally, I'd like to give the builder a stream containing the XSD, or barring that, provide a custom entity resolver that it can use. Any ideas how to go about doing that? Or am I going about this the wrong way?
    Thanks for any advice,
    markl
    null

    Hi,
    I didn't test it wit XML Schema, but any parser that finds a system ID should call an implementation of EntityResolver that returns an InputSource for the system ID.
    An InputSource is a wrapper around an InputStream and its url and it ssystemID.
    An example for sun's parser is on http://www.s-line.de/homepages/gerd_castan/java/resolve.html
    (I "tested" this code also with oracles DTD and Schema parser. This means that I used this code for oracle, too, but I didn't go through the debugger to see what it does.)
    Cheers,
    Gerd

  • Using XML-based object structures to represent data in code/at run-time

    Hello,
    I have quite a "high level" question which has be bothering me for some time, and I haven't found the subject tackled in any books. I believe J2SE/J2EE is not an important divide here.
    Lets say I want to develop a J2SE game application with two programs: a "level designer", and a "level viewer", and I want to store the level files in an XML format.
    My question, and I use this example only to try and illustrate it, is:
    when coding the level designer or viewer, is it reasonable to use an XML-based object hierarchy for representing a level in code/at run-time, i.e. using the standard Java DOM APIs? Or should one (as I would have done before XML came along) develop a set of classes much closer to modelling the real form of a level, and then add a means to convert those objects to/from to XML format?
    This second option of course I would use/would have used if I wasn't thinking about XML, but isn't it sometimes easier to just read in an XML file into a DOM representation and just use the data straight out of that structure, rather than go through the bother of parsing the XML into a set of unrelated objects defined by a different family of classes? What shapes your decision here? And if the second option is best, what is the easiest way of converting to/from the XML?
    Thank you for any advice.
    Greg

    Hi Christian,
    Can I ask: what about if your domain was quite 'close' to an object/DOM representation of XML?
    For instance, what if a game operated by acting out a theatrical script, a spoken conversation, between two characters, perhaps somehow influenced at points by the user, and a particular level was just a different script for the characters.
    One could imagine that the object representation of this would in the end be quite similar to how you'd represent XML, i.e. like a tree of nodes, where each node was a line from the script, and some nodes were a decision point where different nodes could be chosen from.
    Would you still want to avoid using XML-based classes to represent the underlying 'game', or is there a point where you would 'give it' to the similarity and use existing XML structures directly?
    Thank you for any advice
    Greg

  • 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

  • What is use of Reference object in BW

    Hi All,
    I have a small doubt about use of Reference object.Since reference object uses same database table of referenced object and also we can not load data in this.Only loaded data in Referenced object will be available in newly created reference object.
    Also if we create more than 2 objects referencing the same object and used them in InfoProvider then what is use of these objects in that infoprovider whether they have same data and also all properties.
    For example if we have created two objects u2018Sender Cost Centeru2019 and u2018Receiver Cost centeru2019 referencing the same object u2018Cost Centeru2019 and used them in an InfoCube.
    Then what is use of these objects whethet they are refering same database table of u2018Cost Centeru2019.And how we can differentiate them during Reporting.
    Regards
    Vinay

    consider below table:
    cost center (master data table):
    Cost SID, Center name, Other details
    1 ..., xyz....., bla bla
    2 ..., abc....., bla bla
    Purchase Order Header Table (transcation table)
    PONumber, Sender CostCntr, RecevierCostCntr, Other details.
    101, 1, 2, xxxxxx
    102, 2, 1, yyyyy
    in cube, u've SIDs for MD... so when u read the details for say PONo 101, u pick sender SID & receiver SID & read details from master data table...
    other example:
    u r working somewhere.. u have employee ID & ur other details like name, address... all these get store in 0employee master data..
    when in HR module ur salary is generated, salary module will hold only ur employee ID.. but from ur ID other details u can get.. rite?
    same way leave module will have ur Id.. & it can get details bout ur leave & address...
    both is true for ur manager.. but when ur leave is to be approved.. ur manager ID is required...when ur manager apply for leave his managerID is used.. all this get store in same leave module..

  • XSLT and generated text using InDesign with xml

    I have recently switched from Framemaker to InDesign and am still getting to grips with the differences so apologies if this is a very basic query.
    Framemaker was used to format sgml tagged text. You could specify that a particular tag generated a prefix or suffix. You could also specify that the tag should generate the prefix or suffix only under certain circumstances (context rules). The prefixes and suffixes I need to apply are things like open and closing brackets, commas, full stops, and sometimes a bit of text.
    I am told that this can be done with XSLT. There are whole libraries of books on XSLT out there and not knowing anything about the subject I really don't know where to start. Does anyone out there who uses InDesign with xml and XSLT have any tips about where to find useful information on the subject?
    Thanks in advance for any help on the subject.
    Steven

    Yeah, we use to have such feature wayback then. Indesign package into GoLive.  Kindly look through the idea section and vote massively for this idea.

  • 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.

  • Unable to add reference for Excel Object Library for use within Script Task

    I have a requirement to use a Script Tax that needs to reference the Excel Object Model. There are numerous articles on using this such as
    http://www.databasejournal.com/features/mssql/article.php/3921141/SSIS-Script-Task-and-Microsoft-Office-Automation.htm.
    Simply, I need to add a reference to the Microsoft Excel 12.0 Object Library.
    I have selected this from the Object List on the COM tab and when this adds the reference it states 'The System cannot find the reference specified', even though the referenced file for this Object is C:\Program Files(x86)\Microsoft Office\Office12\Excel.exe
    and this file location exists on my local machine ?

    Please search where "Microsoft.Office.Interop.Excel.dll" exist in your system and try adding the reference.
    If you don't find the dll there then there might be problem while installing.
    To install the PIAs by using the redistributable package
    http://www.microsoft.com/en-us/download/details.aspx?id=3508
    http://www.microsoft.com/en-us/download/details.aspx?id=18346
    Regards, RSingh

  • Nokia E61i Push Data using XML Cisco Objects?

    Hi:
    I have a Nokia E61 (wifi) suscribed to a Cisco Call Manager.
    Is there any posibility to Push Data to the device?, like XML Cisco Objects to IP Phone 7970.
    Could I send an SMS without use the mobile network?
    thanks in advance,
    marcelo

    Thanks for the reply. Yes, I did compile all the Java and it
    works OK with a simple Java program. It just will not work in a
    Flex application.
    The java classes are:
    RRA:
    package blah.myPackage;
    import java.util.List;
    import java.util.Collection;
    import flex.data.DataSyncException;
    import flex.data.assemblers.AbstractAssembler;
    class RRA extends AbstractAssembler
    public Collection fill( List fillParameters )
    RRS service = new RRS();
    return service.getSome();
    RRS:
    package blah.myPackage;
    import java.util.ArrayList;
    import java.util.List;
    import java.sql.*;
    import flex.EORS.*;
    class RRS
    public List getSome()
    ArrayList list = new ArrayList();
    String str = "bob";
    RR rr = new RR(str);
    list.add(rr);
    return list;
    RR:
    package blah.myPackage;
    class RR
    private String name;
    public RR() { }
    public RR(String name)
    this.name = name;
    public String getName()
    return this.name;
    public void setName(String name)
    this.name = name;
    I started with something that retrieved data from a database
    but watered it down just to try and get some kind of communication
    between Flex and Java.

  • How to perform an xslt transformation on an xml document dynamically ?

    Hi all,
    I'd like to perform an xslt tranformation on a dynamically generated xml code. I'm looking for a tag which can by useful for it. The tag should take both xml code and xslt code, passed as String arguments (not as names of xml and xslt files). I tried to use xtags library and jstl:transform tag but it did not work. It worked only with plain xml code passed to x-tag. When I try to perform a transformation on a tag body containing an output text tag, the transformation formats only this tag, not its content.
    For example:
    <xtags:style xslt="xslName.xsl">
    <h:outputText value="#{beanName.stringPropertyName}"/>
    </xtags:style>
    Thanks in advance
    Message was edited by:
    opad

    The issue is in the logic f your XSL mapping.
    Use the same source XML and use it with XML Spy to debug why it is not working as you want it to.
    Regards
    Bhavesh

  • Problem inserting XML into object view

    Hi all,
    My environment is :
    Windows NT 4.0
    Oracle 8i 8.1.5
    (NLS_CHARACTERSET = EL8MSWIN1253)
    Apache 1.3.11 Web Server
    Apache JServ 1.1
    XSQL v 0.9.9.1 and XML parser for Java v2,
    XMLSQL that come with it
    I've created an object view as following :
    create table schedules (
    schedule_id varchar2(20),
    description varchar2(100),
    constraint pk_schedule_id primary key (schedule_id)
    create table schedule_details (
    schedule_id varchar2(20),
    starting_time date,
    duration number,
    constraint pk_schedule_dtls primary key (schedule_id, starting_time),
    constraint fk_schedule_id foreign key (schedule_id) references schedules (schedule_id)
    create or replace type schedule_detail_t as object (
    starting_time varchar2(20),
    duration number
    create or replace type schedule_detail_list as table of schedule_detail_t;
    create or replace type schedule_details_t as object (
    schedule_id varchar2(20),
    description varchar2(100),
    details schedule_detail_list
    create or replace view schedule_details_view of schedule_details_t
    with object OID (schedule_id)
    as select schedule_id, description,
    cast(multiset(select schedule_detail_t (to_char(starting_time, 'hh24:mi'), duration) as Detail
    from schedule_details
    where schedule_details.schedule_id = schedules.schedule_id
    ) as schedule_detail_list )
    from schedules;
    And I'm trying to insert using putXML this
    <?xml version = "1.0" encoding = "ISO-8859-1"?>
    <ROWSET>
    <ROW>
    <SCHEDULE_ID>S1112</SCHEDULE_ID>
    <DESCRIPTION>Working 08:00 to 20:00</DESCRIPTION>
    <DETAILS>
    <DETAILS_ITEM>
    <STARTING_TIME>08:00</STARTING_TIME>
    <DURATION>12</DURATION>
    </DETAILS_ITEM>
    </DETAILS>
    </ROW>
    </ROWSET>
    The error I get is
    oracle.xml.sql.OracleSQLXMLException:
    non supported oracle-character-set-174
    Note: no rows have been inserted
    at oracle.xml.sql.dml.OracleXMLSave.insertXML
    When I'm posting using XSQL the XML doesn't get inserted with no error message.
    But when I try this for a change
    <?xml version = "1.0" encoding = "ISO-8859-1"?>
    <ROWSET>
    <ROW>
    <SCHEDULE_ID>S1111</SCHEDULE_ID>
    <DESCRIPTION>Working 08:00 to 20:00</DESCRIPTION>
    </ROW>
    </ROWSET>
    Trying to insert into table (this time) "schedules" using putXML it works ...
    It works on tables and it doesn't work on object views.
    Any piece of advice will be highly appreciated.
    Nick

    No known limitations. Please post the sample DDL to create your object types and object view, along with an example of the example XML document you're trying to insert.

  • Using document function in xsl template - not working in BI Publisher

    Hi,
    I have a requirement where I need to display the data in one xml file based on the contents of a second xml. I am using Oracle BI Publisher 10.1.3.4.1 and template used for report generation is xsl-fo.
    1) ReportData.xml - contains the data xml
    2) ReportFilter.xml - contains the display information.
    I need to display the tags in the ReportData.xml based on the presence , absence of different tags in ReportFiler.xml
    I guess one of the option is to declare 2 datasource as use concatenated datasources. However , I am trying to use the "Document" function that is available in xsl transformation to reference the display xml.
    I have tried the different options for using the document function
    *1) <xsl:variable name="filterCheck" select="document('ReportFilter.xml')"/>*
    Errors out saying : XML-22021: (Error) Error parsing external document: 'Access not allowed : file:/
    C:/OracleBI/oc4j_bi/bin/ReportFilter.xml '.
    *2) <xsl:variable name="filterCheck" select="document('file:///C:/OracleBI/xmlp/XMLP/DemoFiles/ReportFilter.xml')" />*
    Errors out saying ; Caused by: oracle.xdo.parser.v2.XPathException: Access not allowed : file:/C:/Or
    acleBI/xmlp/XMLP/DemoFiles/ReportFilter.xml
    *3) <xsl:variable name="filterCheck" select="document('C:/OracleBI/xmlp/XMLP/DemoFiles/ReportFilter.xml')" />*
    Errors out saying : Caused by: java.net.MalformedURLException: unknown protocol: c
    at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:153
    *4)<xsl:variable name="filterCheck" select="document('file:/C:/OracleBI/xmlp/XMLP/DemoFiles/ReportFilter.xml')" />*
    Errors out syaying : Caused by: oracle.xdo.parser.v2.XPathException: Access not allowed : file:/C:/Or
    acleBI/xmlp/XMLP/DemoFiles/ReportFilter.xml
    I have placed the document I need to access in all the 3 locations mentioned above
    ie in my
    *1) C folder*
    *2) C:/OracleBI/oc4j_bi/bin*
    *3) C:/OracleBI/xmlp/XMLP/DemoFiles*
    Is there any special permissions that I need to grant to enable access to these files?
    Please let me know if anyone has successfully made the document function to reference other xml documents in BI Publisher.
    Regards
    Sujith
    Edited by: user10979469 on Dec 8, 2009 11:48 AM

    Tim,
    Thanks a lot for the reply. Set the option to enable external document access and it works perfectly.
    Just for other who are looking at this post.
    Go to the Report in BI Publisher
    Click on Configure link on the top right
    Go to the Section FO Processing
    Disable external references - Server value is "True" . Set it to "False".
    Apply changes.
    Restarted the oc4j, just to be on safer side (not sure if this is required)
    The document function will open documents from any location on your machine.
    Thanks again Tim
    Regards
    Sujith

  • 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.

Maybe you are looking for

  • Random restarts after upgrading to mavericks and then yosemite

    I have a mid 2009 15in mbp. I noticed after upgrading to mavericks that I began to have random restarts and significant hang ups to the point of me having to restart it on my own. I would run disk utility and repair permissions. The mac would run oka

  • Label help

    I have created a public application and placed all pages public with know authorisation required. Now all my label helps state "Unauthorized access." The labels work fine whilest I am logged in developing the application.

  • Adobe media encoder exports look pixelated and has artifacts.

    Hello all, For the past week we've been having terriable looking videos after compressing them with premiere pro 2014 or AME CC 2014. I though it might be a key framing issue at first. When we look at the final product we have areas where pixilation

  • Anyone recieve their free game yet.

    I just filled out the form for my free game and I was just wondering if anyone has recieved their game yet so I can get a better timeframe  then the 4-8 weeks given.

  • Audigy 1 & Audig

    I have an Audigy 2 ZS OEM internal soundcard supplied with a new Dell computer, question is can i connect this to my older Audigy front dri've panel. If these are not compatible can somebody please advise as to where I can purchase a new Audigy 2 fro