How to obtain the encoding scheme for an XML document

How do you go about reading the encoding scheme for an XML document??
More specifically how do I read the line:
<?xml version="1.0" encoding="UTF-8"?>
(Using Win32 C++ XML Parser 2.0.3 as SAX).
null

I work mostly with the Java versions of the parser so you'll have to make the translation to C++. As far as I know, you can't use the SAX API to access to the encoding.
You need to use the DOM along with Oracle's extension to the basic DOM functionality. Oracle's package, oracle.xml.parser.v2 defines a class which implements the Document interface called XMLDocument. This class has a method, getEncoding(), which returns the encoding. You would use the method in getDocument() in the Parser base class inherited by DOMParser to retrive the XMLDocument.
Jeff

Similar Messages

  • How to obtain the default serie for a document

    Hi,
        Anybody know how can obtain the default serie for a document throw a query??
    I can`t see the relation between the ONNM and the NNM1 tables because the 'dfltseries' field of the ONNM not corresponding with the 'Series' field of the NNM1.
    For example for an A/P Invoice
    Thanks!!

    Hi Mariano,
    According to the SDK Help file, you need to query the NNM2 table
    Series Default
    Table name: NNM2
    ObjectCode     UserSign     Series     DocSubType
    So, the query to retrieve the A/P default series for the manager user would be:
    SELECT T0.Series FROM [dbo].[nnm2] T0 WHERE T0.ObjectCode='13' AND T0.UserSign = 1
    From the SDK you can replace the T0.UserSign = 1 for T0.UserSign = oCompany.UserSignature to retrieve the default series for the current user...
    Regards,
    Vítor Vieira

  • How to identify the Encoding type in an XML

    Hi all,
    Is it possible to identify the encoding set to and XML programatically?
    for example :
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <student>
    </student>
    in this is it possible to find out the encoding value set (ISO-8859-1) ?
    Thanx in Adv,
    Potluri

    Hi, if you have a parser that is only DOM level 2 compliant then there is no way to get at the xml declaration via the JAXP and org.w3c.dom apis. It is expected that DOM level 3 will have the functionality in the Document interface to access the xml declaration attributes like the encoding. I don't know if there are any DOM level 3 parsers available, check xml.apache.org to look at the xerces parsers. However as xml files are text files you could right a program using java.io package to look for the <?xml version ...> tag and then to search that line for the encoding.
    Hope this helps.

  • How to extract the nodes of any given XML document ???

    Hello,
    Greetings! It is an interesting forum.
    A Snippet of XML Schema PurchaseOrder.xsd as given in user guide is as follows
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xdb="http://xmlns.oracle.com/xdb"
    version="1.0" xdb:storeVarrayAsTable="true">
    <xs:element name="PurchaseOrder" type="PurchaseOrderType"
    xdb:defaultTable="PURCHASEORDER"/>
    <xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
    <xs:sequence>
    <xs:element name="Reference" type="ReferenceType" minOccurs="1"
    xdb:SQLName="REFERENCE"/>
    <xs:element name="Actions" type="ActionsType" xdb:SQLName="ACTIONS"/>
    <xs:element name="Reject" type="RejectionType" minOccurs="0"
    xdb:SQLName="REJECTION"/>
    <xs:element name="Requestor" type="RequestorType"
    xdb:SQLName="REQUESTOR"/>
    <xs:element name="User" type="UserType" minOccurs="1"
    xdb:SQLName="USERID"/>
    <xs:element name="CostCenter" type="CostCenterType"
    xdb:SQLName="COST_CENTER"/>
    <xs:element name="ShippingInstructions" type="ShippingInstructionsType"
    xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
    <xs:element name="SpecialInstructions" type="SpecialInstructionsType"
    xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
    <xs:element name="LineItems" type="LineItemsType"
    xdb:SQLName="LINEITEMS"/>
    </xs:sequence>
    </xs:complexType>
    full schema is available in url
    http://download-west.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb03usg.htm#BABBGIED
    The views use XPath expressions and functions such as extractValue() to define the mapping between columns in the view and nodes in the XML document. The following view is created on purchase order schema.
    Creating Relational Views On XML Content
    CREATE OR REPLACE view PURCHASEORDER_MASTER_VIEW
    (REFERENCE, REQUESTOR, USERID, COSTCENTER,
    SHIP_TO_NAME,SHIP_TO_ADDRESS, SHIP_TO_PHONE,
    INSTRUCTIONS)
    AS
    SELECT extractValue(value(p),'/PurchaseOrder/Reference'),
    extractValue(value(p),'/PurchaseOrder/Requestor'),
    extractValue(value(p),'/PurchaseOrder/User'),
    extractValue(value(p),'/PurchaseOrder/CostCenter'),
    extractValue(value(p),'/PurchaseOrder/ShippingInstructions/name'),
    extractValue(value(p),'/PurchaseOrder/ShippingInstructions/address'),
    extractValue(value(p),'/PurchaseOrder/ShippingInstructions/telephone'),
    extractValue(value(p),'/PurchaseOrder/SpecialInstructions')
    FROM PURCHASEORDER p;
    When we register XML Schema in Oracle 9i, the schema elements of XML documents are stored as XMLType, that is, stored using object-relational storage techniques.
    For a small schema, we could build the above view manually, but for large/nested schema, if we have query to build XML documents node list, it will help us to build Relational Views on XML Content.
    How do we extract the nodes of any given XML document through O-R structures or XML DB using XML DB functions?
    Any alternate thoughts are welcome.
    I appreciate your help.
    Regards
    Ram

    Ram
    Once again, I do not think that you can solve the problem you are trying to solve. Fundamentally you need to determine for a given element of a given complex type what are it's child elements. For each of those elements you then need to find out whether or not it in turn has child elements...
    Then you have to think about elements defined as ref rather than type, elements that are substituteable, and the rest of possibilities that can be described with XML Schema.
    If you can solve that problem you're a better man than I as the saying goes. Anyone rather than give you a fish, I'll show you how to at least put a worm on the hook..
    The following query gets the names of the elements inside a each of the global complex types
    Good luck, if you come up with a query to do this I'd love to see it...
    SQL> column COMPLEX_TYPE format A32
    SQL> column ELEMENT format A32
    SQL> --
    SQL> select extractvalue
    2 (
    3 value(ct),
    4 '/xs:complexType/@name',
    5 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
    6 ) COMPLEX_TYPE,
    7 extractvalue
    8 (
    9 value(et),
    10 '/xs:element/@name',
    11 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
    12 ) ELEMENT
    13 from resource_view,
    14 table
    15 (
    16 xmlsequence
    17 (
    18 extract
    19 (
    20 res,
    21 '/r:Resource/r:Contents/xs:schema/xs:complexType',
    22 'xmlns:r="http://xmlns.oracle.com/xdb/XDBResource.xsd"
    23 xmlns:xs="http://www.w3.org/2001/XMLSchema"')
    24 )
    25 ) ct,
    26 table
    27 (
    28 xmlsequence
    29 (
    30 extract
    31 (
    32 value(ct),
    33 '/xs:complexType/*/xs:element',
    34 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
    35 )
    36 )
    37 ) et
    38 where equals_path(res,'/home/SCOTT/poSource/xsd/purchaseOrder.xsd') = 1
    39 /
    COMPLEX_TYPE ELEMENT
    -------------------------------- ------------------------PurchaseOrderType Reference
    PurchaseOrderType Actions
    PurchaseOrderType Reject
    PurchaseOrderType Requestor
    PurchaseOrderType User
    PurchaseOrderType CostCenter
    PurchaseOrderType ShippingInstructions
    PurchaseOrderType SpecialInstructions
    PurchaseOrderType LineItems
    LineItemsType LineItem
    LineItemType Description
    LineItemType Part
    ActionsType Action
    RejectionType User
    RejectionType Date
    RejectionType Comments
    ShippingInstructionsType name
    ShippingInstructionsType address
    ShippingInstructionsType telephone
    19 rows selected.

  • How to change the Encoding type of a XML

    Hi all,
    I'm having a XML(generated at run time) with UTF-8 Encoding. If I'm going to parse it, getting an error saying "*Document root element is missing*".
    If I change the encoding to ANSI, it parses without error.
    How can I change the encoding type of a documnet ?
    Any comment welcome.
    Kaushalya

    There's no such thing as the "encoding of a String". If you produced a String from a sequence of bytes using the wrong encoding, you may not be able to repair that problem by hacking about in your code. You're better off to produce the String using the correct encoding in the first place. Read this for more information about XML and encodings as you appear to be misunderstanding basic concepts:
    [http://skew.org/xml/tutorial/]

  • How to find the GL Account for a Billing Document Item?

    Hi All,
       For a specific Billing Document Item, how to fetch the corresponding GL Account No.?
       I tried the below approach.
       Using the Billing Document Number, I fetched the corresponding Accounting Document No. then I tried to match the item of billing document with the item of Accounting Document by comparing the amount and then fetch the GL Account from table BSEG. When I compared the line items of both the documents, the no. of line items in the Accounting Document is more compared to the no. of line items in the Billing Document. I tried to match the items using Amount, but what if more than one item has the same amount but different GL Account No.?

    Hi,
    i would agree with what 'Rajasekhar Dinavahi' said.
    quote,
    <b>Hi
    If you open the billing document in VF03, click on 'Accounting' , select the accounting document, click on 'Administrat. data' tab.
    Here you will find the Reference Document and Reference item no.
    Regards,
    Raj
    </b>
    unquote
    The reference Doc will be XBLNR .
    Regards,
    Shehryar

  • How to extract the element name of an XML Document

    This is how my xml file looks like:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <nsiData>
    - <instance timestamp="2011-05-25 19:01:00">
    <AECI>47.00</AECI>
    <EEI>-553.00</EEI>
    <EES>-91.00</EES>
    <EKPC>-22.00</EKPC>
    <LGEE>-140.00</LGEE>
    <MHEB>-1376.00</MHEB>
    <MISO>-4725.00</MISO>
    <MOWR>55.00</MOWR>
    <ONT>-872.00</ONT>
    <OVEC>-144.00</OVEC>
    <PJM>-1438.00</PJM>
    <SPA>-55.00</SPA>
    <SPC>20.00</SPC>
    <SWPP>69.00</SWPP>
    <TVA>-69.00</TVA>
    <WAUE>-158.00</WAUE>
    </instance>
    - <instance timestamp="2011-05-25 19:02:00">
    <AECI>47.00</AECI>
    <EEI>-555.00</EEI>
    <EES>-91.00</EES>
    <EKPC>-22.00</EKPC>
    <LGEE>-148.00</LGEE>
    <MHEB>-1375.00</MHEB>
    <MISO>-4709.00</MISO>
    <MOWR>55.00</MOWR>
    <ONT>-871.00</ONT>
    <OVEC>-144.00</OVEC>
    <PJM>-1426.00</PJM>
    <SPA>-55.00</SPA>
    <SPC>20.00</SPC>
    <SWPP>82.00</SWPP>
    <TVA>-69.00</TVA>
    <WAUE>-158.00</WAUE>
    </instance>
    </nsiData>
    I want to extract the element name and the element value from this file. I was trying to do it this way:
    SELECT datetime,
    loc.aeci_value,
    loc.eei_value
    FROM temp_xmltype txml,
    XMLTABLE ('/nsiData' PASSING xmldata) misolmp,
    XMLTABLE ('/nsiData/instance' PASSING misolmp.object_value
    COLUMNS
    datetime VARCHAR2(100) PATH '/instance/@timestamp') misodt,
    XMLTABLE ('/nsiData/instance' PASSING misolmp.object_value
    COLUMNS
    aeci_value VARCHAR2(100) PATH '/instance/AECI',
    eei_value VARCHAR2(100) PATH '/instance/EEI') loc
    WHERE txml.feed_id = 127
    But doing it this way does not get me AECI as a column value. Is there any way to get the element name as a column value.
    I am on 11gR2

    The SQL statement you wrote returns 4 rows and there is only two AECI values in there. The corrected version of what you wrote should really be
    SELECT loc.datetime,
           loc.aeci_value,
           loc.eei_value
      FROM temp_xmltype txml,
           XMLTABLE ('/nsiData/instance' PASSING txml.xmldata
                     COLUMNS
                     datetime   VARCHAR2(100) PATH '@timestamp',
                     aeci_value VARCHAR2(100) PATH 'AECI',
                     eei_value  VARCHAR2(100) PATH 'EEI') loc
    WHERE txml.feed_id = 127;If you know the element name and want it returned as a column name, why not just hard code it in the SQL statement, such as
    SELECT loc.datetime,
           'AECI' as AECI,
           loc.aeci_value,
           'EEI' AS EEI,
           loc.eei_value
      FROM temp_xmltype txml,
           XMLTABLE ('/nsiData/instance' PASSING txml.xmldata
                     COLUMNS
                     datetime   VARCHAR2(100) PATH '@timestamp',
                     aeci_value VARCHAR2(100) PATH 'AECI',
                     eei_value  VARCHAR2(100) PATH 'EEI') loc
    WHERE txml.feed_id = 127;I suspect you are really looking for something like {message:id=9535532}
    Note: See the FAQ (under your sign-in name) for how to use the code tag to format code as shown above.

  • How to change the fonts (permanently) for new (empty) documents in pages

    I am searching for a way to change the settings/preferences of Pages / Numbers and Co such, that the standard font is not Helvetic, but a font of my choice. I am used to this from the MS Office products in my job, but want to keep my Mac "clean" and "pure".
    I know that I can create and save templates. But somehow I feel, it must be possible to just open an empty/blank document with the font of my choice.
    Any idea?
    Best regards
    Diethard

    --
    --[SCRIPT setiWork_defaultfont]
    Si vous choisissez "Pages" vous verrez:
    /* ----- Font Names */
    "FONT_Helvetica" = "Helvetica";
    "FONT_Helvetica-Bold" = "Helvetica-Bold";
    "FONT_Helvetica-Oblique" = "Helvetica-Oblique";
    "FONT_LucidaGrande" = "LucidaGrande";
    La police utilisée par défaut dans les textes, les notes et les tables est celle dont le descripteur est "FONT_Helvetica"
    éditez la ligne correspondante comme suit:
    "FONT_Helvetica" = "nomDeVotrePolice";
    Par exemple, pour utiliser Palatino, remplacez nomDeVotrePolice par "Palatino-Roman"
    Enregistrez le fichier ainsi modifié par (cmd + S)
    Si vous choisissez "Numbers" vous verrez:
    /* ----- Font Names */
    "FONT_Helvetica" = "Helvetica";
    "FONT_HelveticaNeue" = "HelveticaNeue";
    "FONT_HelveticaNeue-Bold" = "HelveticaNeue-Bold";
    "FONT_LucidaGrande" = "LucidaGrande";
    "FONT_MarkerFelt-Thin" = "MarkerFelt-Thin";
    La police utilisée par défaut dans les textes, les notes et les tables est celle dont le descripteur est "FONT_HelveticaNeue"
    éditez la ligne correspondante comme suit:
    "FONT_HelveticaNeue" = "nomDeVotrePolice";
    Si vous choisissez "Keynote" vous verrez:
    "STYLESeries2" = "Series_2";
    "STYLE_None" = "Aucun";
    "STYLESeries5" = "Series_5";
    "STYLESeries3" = "Series_3";
    "FONT_LucidaGrande" = "LucidaGrande";
    "FONT_Helvetica" = "Helvetica";
    "STYLE_Free Form" = "Format libre";
    "STYLESeries1" = "Series_1";
    "FONT_GillSans" = "GillSans";
    "STYLE_Normal" = "Normal";
    "STYLESeries0" = "Series_0";
    "FONT_MarkerFelt-Thin" = "MarkerFelt-Thin";
    "STYLESeries4" = "Series_4";
    La police utilisée par défaut dans les textes, les notes et les tables est celle dont le descripteur est "FONT_GillSans"
    éditez la ligne correspondante comme suit:
    "FONT_GillSans" = "nomDeVotrePolice";
    Une liste de 564 noms de polices est disponible sur mon iDisk:
    <http://idisk.me.com/koenigyvan-Public?view=web>
    Téléchargez:
    ForiWork:despolices.numbers.zip
    If you choose "Pages" you will see:
    /* ----- Font Names */
    "FONT_Helvetica" = "Helvetica";
    "FONT_Helvetica-Bold" = "Helvetica-Bold";
    "FONT_Helvetica-Oblique" = "Helvetica-Oblique";
    "FONT_LucidaGrande" = "LucidaGrande";
    The font used as default for tables is the one whose descriptor is "FONT_Helvetica"
    edit the line as:
    "FONT_Helvetica" = "yourFontName";
    For instance, to use Palatino, replace "yourFontName" by "Palatino-Roman"
    Save the file (cmd + S)
    If you choose "Numbers" you will see:
    /* ----- Font Names */
    "FONT_Helvetica" = "Helvetica";
    "FONT_HelveticaNeue" = "HelveticaNeue";
    "FONT_HelveticaNeue-Bold" = "HelveticaNeue-Bold";
    "FONT_LucidaGrande" = "LucidaGrande";
    "FONT_MarkerFelt-Thin" = "MarkerFelt-Thin";
    The font used as default for tables is the one whose descriptor is "FONT_HelveticaNeue"
    edit the line as:
    "FONT_HelveticaNeue" = "yourFontName";
    If you choose "Keynote" you will see:
    "STYLESeries2" = "Series_2";
    "STYLE_None" = "Aucun";
    "STYLESeries5" = "Series_5";
    "STYLESeries3" = "Series_3";
    "FONT_LucidaGrande" = "LucidaGrande";
    "FONT_Helvetica" = "Helvetica";
    "STYLE_Free Form" = "Format libre";
    "STYLESeries1" = "Series_1";
    "FONT_GillSans" = "GillSans";
    "STYLE_Normal" = "Normal";
    "STYLESeries0" = "Series_0";
    "FONT_MarkerFelt-Thin" = "MarkerFelt-Thin";
    "STYLESeries4" = "Series_4";
    The font used as default for tables is the one whose descriptor is "FONT_GillSans"
    edit the line as:
    "FONT_GillSans" = "yourFontName";
    A list of 564 names is available on my iDisk:
    <http://idisk.me.com/koenigyvan-Public?view=web>
    Download:
    ForiWork:despolices.numbers.zip
    Yvan KOENIG (Vallauris, FRANCE)
    5 mars 2009
    on run
    if my parleFrancais() then
    set prompt1 to "Choisir l'application"
    set prompt2 to "Choisir un modèle"
    set prompt3 to "Choisir une localisation"
    else
    set prompt1 to "Choose the application"
    set prompt2 to "Choose a template"
    set prompt3 to "Choose a localization"
    end if
    choose the application *)
    set theApp to choose from list {"Pages", "Numbers", "Keynote"} with prompt prompt1
    if theApp is false then error -128
    set theApp to item 1 of theApp
    define some parameters *)
    if theApp is "Pages" then
    set permitted to {"com.apple.iWork.Pages.template", "com.apple.iWork.Pages.sfftemplate"}
    set sub to "Templates"
    set theStrings to "Localizable.strings"
    else if theApp is "Numbers" then
    set permitted to {"com.apple.iWork.Numbers.template", "com.apple.iWork.Numbers.sfftemplate"}
    set sub to "Templates"
    set theStrings to "Localizable.strings"
    else (* it is "Keynote" *)
    set permitted to {"com.apple.iWork.Keynote.kth", "com.apple.iWork.Keynote.sffkth"}
    set sub to "Themes"
    set theStrings to "fontsAndText.strings"
    end if
    choose the template *)
    set p2f to (path to applications folder as text) & "iWork '09:" & theApp & ".app:Contents:Resources:" & sub
    if 5 > (system attribute "sys2") then (*
    it's Mac OS X 10.4.11 *)
    set allowed to permitted
    else (*
    it's Mac OS X 10.5.6 with a bug with Choose File *)
    set allowed to {}
    end if
    set p2f to (choose file with prompt prompt2 default location (p2f as alias) of type allowed) as text
    choose the localization folder *)
    set p2f to p2f & "Contents:Resources"
    set p2f to (choose folder default location (p2f as alias) with prompt3) as text
    open the localizable.strings file *)
    tell application "Finder"
    set nb to count of (files of folder p2f whose name starts with "localizable")
    if nb = 1 then duplicate file theStrings of folder p2f (* as there is no backup, duplicate "localizable.strings" for safe *)
    open file theStrings of folder p2f
    end tell -- Finder
    end run
    --=====
    on parleFrancais() (* Check if Pages is running in French *)
    local z
    try
    tell application "Pages" to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z = "Annuler")
    end parleFrancais
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France.) mardi 11 août 2009 11:29:14

  • How to obtain the license for the mentioned products.

    Hi All,
    Please help me in below licensing issues.
    1) Our functional team got the below error while accessing "Job Scheduling Workbench".
    Error: The Workbench is inaccessible because Oracle Manufacturing Scheduling has not been licensed. Please work with your Account Manger to purchase the license.
    2) Another error message while accessing the navigation Flow Manufacturing --> Product Sync --> Flow Routings
    Error: APP-BOM 20972: You cannot access this form
    Cause: You do not have a license for Oracle Flow Manufacturing.
    Action: Obtain a license for Oracle Flow Manufacturing.
    Please guide me how to obtain the license for the above products.
    Environment: eBS R12.1.3 on Linux 5.8
    Regards,
    Siva

    Thanks for providing the document. I follow the document and get back to you for any issues.
    Regards,
    Siva.

  • Configuring the authentication scheme for a web application

    Hi all,
    We have a requirement to configure the authentication scheme for a web application where some set of users should access the application using basic LDAP (userid/password) authentication and some using digital certificate authentication.
    Since the deployment descriptor (web.xml) allows only one directive for auth-method in logic-config, we want to know if there is any other way to achieve this requirement. We are thinking of a custom login module approach. But we are not able to figure out how to configure the auth-method at runtime from the login servlet.
    Please let us know if there is any other approach to achieve this.
    I will be thankful if any body shares any specific solution to this issue.

    This forum is probably not the correct one to ask in. It's more related to the web container than Java Programming.
    Kaj

  • How to find the DB schema of XI DB tables to operate on the XI DB table

    Hi all,
    I have to execute some queries on internal XI DB. For this I need the schema name of the DB table where the data about the message is available. Can anyone tell, how to find the DB schema-name of the DB table? I have PI 7.1 system with internalDB.
    How to access the DB of the PI 7.1 system using NWA?
    Regards,
    Soorya

    Hi,
    The PI 7.1 Server shall definitely posses a Database. This Database shall have the ABAP and Java Dictionary tables in 2 different database schemas.You sholud be getting the names of the schema from the basis team supporting your server.
    I hope your are referring to the Java DB Schema for access. In order to get the schema name for the Java Dictionary, you should have access to the NetWeaver Adminstrator (NWA) of the PI Server.
    Logon to NWA, navigate to Configuration Management --> Infrastructure --> Application Resources. Select the Resurce Type to show as JDBC Drivers. Select the system driver and click on Dependent JDBC Datasources. This table should give you the schema name of the Java Table Storage of the PI 7.1 server.
    Regards,
    Alka.

  • How to get the current schema name

    Hi,
    Can anybody please tell me how to get the current schema name, there is some inbuilt function for this,but i am not getting that. Please help me.
    Thanks
    Jogesh

    ok folks, I found the answer at Tom's as usual.
    http://asktom.oracle.com/tkyte/who_called_me/index.html
    I rewrote it into a function for kicks. just pass the results of DBMS_UTILITY.FORMAT_CALL_STACK to this function and you will get back the owner of the code making the call as well some extra goodies like the name of the code and the type of code depending on the parameter. This ignores the AUTHID CURRENT_USER issues which muddles the schemaid. Quick question, does the average user always have access to DBMS_UTILITY.FORMAT_CALL_STACK or does this get locked down on some systems?
    cheers,
    paul
    create or replace
    FUNCTION SELF_EXAM (
       p_call_stack VARCHAR2,
       p_type VARCHAR2 DEFAULT 'SCHEMA'
    ) RETURN VARCHAR2
    AS
       str_stack   VARCHAR2(4000);
       int_n       PLS_INTEGER;
       str_line    VARCHAR2(255);
       found_stack BOOLEAN DEFAULT FALSE;
       int_cnt     PLS_INTEGER := 0;
       str_caller  VARCHAR2(30);
       str_name    VARCHAR2(30);
       str_owner   VARCHAR2(30);
       str_type    VARCHAR2(30);
    BEGIN
       str_stack := p_call_stack;
       -- Loop through each line of the call stack
       LOOP
         int_n := INSTR( str_stack, chr(10) );
         EXIT WHEN int_cnt = 3 OR int_n IS NULL OR int_n = 0;
         -- get the line
         str_line := SUBSTR( str_stack, 1, int_n - 1 );
         -- remove the line from the stack str
         str_stack := substr( str_stack, int_n + 1 );
         IF NOT found_stack
         THEN
            IF str_line like '%handle%number%name%'
            THEN
               found_stack := TRUE;
            END IF;
         ELSE
            int_cnt := int_cnt + 1;
             -- cnt = 1 is ME
             -- cnt = 2 is MY Caller
             -- cnt = 3 is Their Caller
             IF int_cnt = 1
             THEN
                str_line := SUBSTR( str_line, 22 );
                dbms_output.put_line('->' || str_line);
                IF str_line LIKE 'pr%'
                THEN
                   int_n := LENGTH('procedure ');
                ELSIF str_line LIKE 'fun%'
                THEN
                   int_n := LENGTH('function ');
                ELSIF str_line LIKE 'package body%'
                THEN
                   int_n := LENGTH('package body ');
                ELSIF str_line LIKE 'pack%'
                THEN
                   int_n := LENGTH('package ');
                ELSIF str_line LIKE 'anonymous%'
                THEN
                   int_n := LENGTH('anonymous block ');
                ELSE
                   int_n := null;
                END IF;
                IF int_n IS NOT NULL
                THEN
                   str_type := LTRIM(RTRIM(UPPER(SUBSTR( str_line, 1, int_n - 1 ))));
                 ELSE
                   str_type := 'TRIGGER';
                 END IF;
                 str_line  := SUBSTR( str_line, NVL(int_n,1) );
                 int_n     := INSTR( str_line, '.' );
                 str_owner := LTRIM(RTRIM(SUBSTR( str_line, 1, int_n - 1 )));
                 str_name  := LTRIM(RTRIM(SUBSTR( str_line, int_n + 1 )));
              END IF;
           END IF;
       END LOOP;
       IF UPPER(p_type) = 'NAME'
       THEN
          RETURN str_name;
       ELSIF UPPER(p_type) = 'SCHEMA.NAME'
       OR    UPPER(p_type) = 'OWNER.NAME'
       THEN
          RETURN str_owner || '.' || str_name;
       ELSIF UPPER(p_type) = 'TYPE'
       THEN
          RETURN str_type;
       ELSE
          RETURN str_owner;
       END IF;
    END SELF_EXAM;

  • Numbers to CSV export script: how to specify the encoding?

    Hi,
    I'm using the following script to export a Numbers document to CSV:
    # Command-line tool to convert an iWork '09 Numbers
    # document to CSV.
    # Parameters:
    # - input: Numbers input file
    # - output: CSV output file
    # Attik System, Philippe Lang
    # Creation date: 31 mai 2012
    # Modification date:
    on run argv
      # We retreive the path of the script
              set myPath to (path to me)
              tell application "Finder" to set myFolder to folder of myPath
      # We get the command line parameters
              set input_file to item 1 of argv
              set output_file to item 2 of argv
      # We retreive the extension of the file
              set theInfo to (info for (input_file))
              set extname to name extension of (theInfo)
      # Paths
              set input_file_path to (myFolder as text) & input_file
              set output_file_path to (myFolder as text) & output_file
              if extname is equal to "numbers" then
        tell application "Numbers"
          open input_file_path
          save document 1 as "LSDocumentTypeCSV" in output_file_path
          close every window saving no
        end tell
              end if
    end run
    It works fine, except that I don't know how to specify the encoding of the text in the CSV file (Latin1, MacRoman, Unicode). This option is available in the export dialog of Numbers. Any hint on how to do that is welcome. (GUI Scripting?)
    Where can I find documentation on the iWork "vocabulary" available? Is there a definitive documentation somewhere? I tried to record an manual export in the script editor, without success. Script is more or less empty.
    Thanks!
    Philippe Lang

    A further note from Yvan. He's made some revisions to the script sent earlier.
    --{code}
    --[SCRIPT export to CSV with selected encoding]
    I added some features.
    (1) Defining the encoding thru the preferences file apply only if
    the application is not in use because the file is read only once in a session.
    A test urge you to quit Numbers if it is running.
    (2) info for is deprecated so it may be removed by Apple tomorrow.
    I no longer use it.
    (3) just for the fun, I added a piece of code allowing you to select the encoding on the fly.
    Thanks to the property chooseEncodingInScript, at this time the script use Unicode (UTF-8)
    (4) I'm wondering which tool is used to launch this script,
    I don't know the way to pass arguments when I run one.
    Yvan KOENIG (VALLAURIS, France)
    2012/06/13
    property chooseEncodingInScript : false
    true = the script will ask you to select the encoding
    false = the script use the embedded encoding
    on run argv
      set input_file to (item 1 of argv) as text
      set output_file to (item 2 of argv) as text
      set myPath to (path to me) as text
              tell application "System Events"
      set theProcesses to name of every application process
      set myFolder to path of container of (disk item myPath)
      set input_file_path to myFolder & input_file
      set output_file_path to myFolder & output_file
      set extname to name extension of (disk item input_file)
      end tell
              if extname is "numbers" then
                        if "Numbers" is in theProcesses then error "Please, quit “Numbers” before running this script !"
      if chooseEncodingInScript then
                                  set theList to {"Mac OS Roman", "Unicode (UTF-8)", "Windows Latin 1"}
                                  set maybe to choose from list theList with prompt "Choose the default encoding applying to export as CSV"
      if maybe is false then
      error number -128
      else if item 1 of maybe is item 1 of theList then
                                            30 -- Mac OS Roman
      else if item 1 of maybe is item 2 of theList then
                                            4 -- Unicode (UTF-8)
      else
                                            12 -- Windows Latin 1
      end if
      else
                                  4 -- Unicode (UTF-8)
      end if
                        do shell script "defaults write com.apple.iWork.Numbers CSVExportEncoding  -int " & result
      tell application "Numbers"
      open input_file_path
                                  save document 1 as "LSDocumentTypeCSV" in output_file_path
      close every window saving no
      end tell
      end if
    end run
    --{code}
    Regards,
    Barry

  • How to determine the proper size for Oracle 8i Data Base Objects

    Hi,
    I'm working on an Oracle 8i Data base. I'd like to know how to determine the proper size for the Data Base objects such as tables, datafiles, tablespaces...
    Thanks.

    Start with the docs.
    http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a76956/schema.htm#949
    Best Regards
    Krystian Zieja / mob

  • How to obtain the row data in the component datatable?

    if I want to edit a row data, and then know which row is edited in the component datatable, and how to do?
    How to obtain the row data in the component datatable, and update it to database, not simplely edit a simple table
    Any ideas? Thanks

    Thank you very much for your help Alexander !
    It's quite confusing when you leave Struts and try to adapt your projects for JSF for the first time...
    I wanted to click on a row with a "onMouseClick" on the TR tag like I used to do in Struts/JSTL. But it seems to be impossible in a dataTable.
    Ok then. I've added a column at the end of the row with an icon.
    But eventually I didn't need to declare link parameters.
    In my BackingBean I did like this :
    public String selectEventForUpdate() throws IllegalAccessException, InvocationTargetException {
            PortletAgenda event = (PortletAgenda) JSFUtils.getInRequestMap("event");
            BeanUtils.copyProperties(this, event);
            return null;
       }JSFUtils.getInRequestMap(...) is a method I wrote in a util object :
    public static Object getInRequestMap(String name) {
            Object res = null;
            Map requestMap=FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
            if (requestMap!=null) {
                res=requestMap.get(name);
            return res;
    }  " event " is the name of the item in my dataTable list.
    My backingBean has the same attributes as "event".
    So when the page is reloaded I have a backingBean full with the selected properties to edit/update.
    Thanks to your reply I realized that putting this form in the middle of the dataTable seems to be impossible.
    So I put this form in a floating DIV in front of the table with a shadow.
    It works :o) !
    But I'm a little bit disapointed to be honest...
    I used to build my web applications with Struts and JSTL and doing this kind of interface was really easy.
    I've decided 3 days ago to convert into JSF because the "GUI Layer" seemed to be improved.
    But now I realize that I cannot put a onMouseOver and onMouseClick on a row and I cannot display a different row in the middle of a table....
    I think it's a shame because there is a facet for header and footer.
    And it would be great if we could create our own personal facet that appears only if a condition is true.
    For exemple " if the current item id is the same as the request parameter id then display the following facet content ....... (with a panel group and a form inside to update the row) "
    It's easy to do that with JSTL thanks to c:forEach and c:if but it seems to be impossible to use JSTL tags like this during the dataTable iteration.
    And JSF tags seems to have no logical tags like " if " or loops that can be nested in dataTable.
    I really need to realize this interface (you click on a row then an edit form appears where you clicked).
    Do I have to write a component myself that extends dataTable?
    Do you know if writing such a component is hard to do for a beginner like me?
    (I've juste discovered JSF 3 days ago and I've used Struts/JSTL for 2 years til now)
    I'd be glad to have much advices from you about that.
    Regards

Maybe you are looking for