Extract the contents of an XML string in offline mode

HI gentlemen,

Could you help me solve this problem? I had a string of Java (see below) read in a smart German eHealth card. I have to extract the tag values and put them in local variables for further processing in my Java module. How to move forward without connecting to a database, it is enough to analyze the source - the string variable? Note that the lines are separated by only 0x0A.
<?xml version="1.0" encoding="ISO-8859-15" standalone="yes"?>
<UC_PersoenlicheVersichertendatenXML CDM_VERSION="5.1.0" xmlns="http://ws.gematik.de/fa/vsds/UC_PersoenlicheVersichertendatenXML/v5.1">
    <Versicherter>
        <Versicherten_ID>X110101627</Versicherten_ID>
        <Person>
            <Geburtsdatum>19840717</Geburtsdatum>
            <Vorname>Johanna</Vorname>
            <Nachname>Düsterbehn</Nachname>
            <Geschlecht>W</Geschlecht>
            <StrassenAdresse>
                <Postleitzahl>93055</Postleitzahl>
                <Ort>Regensburg</Ort>
                <Land>
                    <Wohnsitzlaendercode>D</Wohnsitzlaendercode>
                </Land>
                <Strasse>Sulzfeldstraße</Strasse>
                <Hausnummer>7</Hausnummer>
            </StrassenAdresse>
        </Person>
    </Versicherter>
</UC_PersoenlicheVersichertendatenXML>
Thank you very much for your help,
sincere friendships of

Miklós HERBOLY
java.lang.NoClassDefFoundError: XpathSampleClass (wrong name: XPathSampleClass)

If you use my code sample in extenso, the class is named 'XPathSampleClass' (capital P), and of course the .class file must have the same name.

Tags: Oracle Development

Similar Questions

  • Alteration of the content of an XML node in java

    Hi all

    I change the contents of an XML node using java, using the method of setTextContent() a node.

    Sometimes I also add child nodes of a node. In this case, when I add the child nodes of a given node, when I print the xml data, I see the added nodes.

    for example:

    Initial XML:

    < a > < / a >
    < b > < / b >
    < c > < / c >


    For my project requirement, based on certain conditions, I do 'a' 'b', 'c' as children nodes nodes. I reached this output.


    The problem is

    FINAL XML:

    < a > < b > < / b > < c > < / c > < / a >


    I get the nodes children in the same line as above. But the power required should be as below.


    REQUIRED XML

    < a >
    < b > < / b >
    < c > < / c >
    < /a >

    I also used the Doc.normalize () function. But still, it helps strength.

    Kindly help me in this regard.

    Thank you
    Sabarisri. N

    Hello

    You can try to transform the result as below:

    Transformer transformer = TransformerFactory.newInstance () .newTransformer ();
    transformer.setOutputProperty (OutputKeys.INDENT, 'yes');

    initialize the StreamResult with the object of the file to save to file
    StreamResult result = new StreamResult (new StringWriter());

    DOMSource source = new DOMSource (doc); Here, the doc is you XML document.
    transform. Transform (source, result);

    String xmlString = result.getWriter (m:System.NET.SocketAddress.ToString ());
    System.out.println (xmlString);

    Thank you best regards &,.
    Nilesh Sahni (www.infocepts.com)

    Published by: Nilesh on August 30, 2011 12:31

  • How to pass the content of an xml element in the text frame in inDesign Script

    var XMLFile = File.openDialog ("select XML Files... ») ;

    var doc = app.activeDocument;

    If (!) App.Documents.Length)

    {alert ("ERROR: Document not opened");}

    return;

    }

    doc.importXML (XMLFile);

    var firstFigureNode = doc.xmlElements [0] .xmlElements [1] .xmlElements [0];

    var lableNode = firstFigureNode.xmlElements [0];

    var lableNodeText = lableNode.contents;

    myFrame var = doc.textFrames.add ({geometricBounds: [-13, 13, 3, -3]});

    lableNodeText.move (LocationOptions.AFTER, myFrame.texts [0]);

    ========================================================

    My requirement is: == > > move the content of an xml element in the text by inDesign Script block, but XML InDesign file Structure should not be change & data in the XML Structure should remain as it was before...

    I tried to code above, but it does not work...

    Please can someone help me in solving this problem...

    It does not work correctly...

    It moves firstFigureNode in myFrame...

    firstFigureNode.placeXML (myFrame);

    ===>> For Apple Script try below Code ===>>

    myFrame markup using firstFigureNode

  • I'm new in indesign scripting, please tell me how to write a script to get the contents of an XML element and then sort all the content

    I'm new in indesign scripting, please tell me how to write a script to get the contents of an XML element and then sort all the content

    Hello

    Can the code below is useful for you, but I do not know how to sort.

    Change the tag based on your employment application.

  • The network location of my folders in offline mode has changed while I was offline. How to re - run my offline file path to the new location so I can sync?

    The network location of my folders in offline mode has changed while I was offline. (HE moved to a new server).  How to re - run my offline file path to the new location so I can sync?

    Windows System 7.
    Hello
    Welcome to the Microsoft community forums!
    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums.
    Hope this information helps.
  • Extract the value of an xml file-

    Hello
    I have a requirement that needs to store the contents of the XML db tables. Here I give you the details of the sample, it must extract values from the XML file and place these values in the mapping table.

    Sample:

    I created a table - create the table txt_xml of xmltype.

    insert into table txt_xml values (xmltype ('))
    < NewDataSet >
    "" < DerivativeSecurity FAS157Level = "3" FAS157MVAdjustable = "N" OriginalMV = FAS157MVDelta "573174.3253" = "0.0" FAS157AdjustedMV = "573174.3253" PLCurrency = "USD" DerivativeSecurityID = "2009-BFWD-0001TRD' MetDerivativeID = '2009-BFWD-0001' MurexTransactionNumber = '36319' Trader '_GTELL' BuySell = =" B "DetailType = 'TRD' DerivativeType = 'BFWD' AL_ManagementSide = 'Active' CounterpartyCode = '3045' CounterpartyName =" ' JPM / CHASE "CurrencyCode ="USD"Coupon ="0,0"FixedFloatingIndicator ="FIXRT"IndexMultiplier ="1.0"IndexName = 'Bond' ="0,0"Comment11 = margin" PCG 6.05 01 / 03 / 34 "Comment12 ="2009-BFWD-0001"Comment13 ="694308GE1"Comment21 =" "Comment22 = Comment23"83003169"="1 618 300"TradeComment =" are created-credit of the assets for the current article "" specific - anticipation Hedge - PCG FWD 6.05% 01/03/2034. Are created. "" "" "" - Original M"OptionCallPut =" "OptionType =" "SettleType = 'Cash' RefISIN =" "RefObligation =" "sensitivity ="15044.6506"EffectiveConvexity ="0,0"Vega ="0,0"NextResetDate =" "LastResetDate =" "EffectiveDuration ="13.9289"Instrument"Bond"IssuerCode ="19039"IssuerName = ="PACIFIC GAS' IssuerREDCode '6FD738' strategy = = "CRD-PROT-07" StrikePrice = MaturityDate '105.89' = "TickerSymbol =" 2010-01-04 "" "MetPay =" "MetRec =" "Payrec =" P "RiskSection =" "HedgedItem =" deadline specific asset "ResetFrequency =" "ResetFrequencyNumber =" "PaymentFrequency =" "PaymentFrequencyNumber =" "CapFloorCoupon ="0.0"RefIndexRate ="0,0">"
    < name of classification = "XHSEC" Value = "Derivatives" ValueDescription = "950" / >
    < name of classification = "XSEC" ValueDescription = 'Credit' Value = '430' / >
    < name of classification = "XLEV1" ValueDescription = value 'Before' = "9400" / >
    < name of classification = "XLEV2" ValueDescription = 'Hedge' Value = "150000" / >
    < / DerivativeSecurity >
    ((< / NewDataSet > '));

    now what I need is OriginalMV value of this XML field. Please help me

    Published by: Govind2 on February 5, 2010 08:33

    Yes it will fail because error explains everything... excerpt from value does not return several values for a simple xpath...

    so in this case you must use the function xmltable...

     SELECT column_value
       FROM some_things v,
      xmltable('for $i in /NewDataSet/DerivativeSecurity return $i/@FAS157Level' passing value(v))
    

    edit your table name in the code above... and confirm

    Ravi Kumar

  • HOW TO EXTRACT THE CONTENT INTO RECOVERY?

    Hi all

    I use HP Pavilion 5vt. My laptop is composed of 3 partitions: C, D and E (what is disk backup.).

    I decided to get my laptop to the initial state of the plant. However, before I receovered, I copied a folder of my own - no HP factory - e software (I didn't know that the E partition could not be reached). Then I successfully recover my laptop.

    The problem is, my own folder software disappeared, even if the partition of size E again proved existence of this file. When I clicked to E, no there wasn't a warning appeared which said that "this partition must not be delete alter.

    I'm not good in IT: this is why, I really need your help to extract the folder I was stupidly cut and paste for before E.

    I highly appreciate your help.

    Best regards

    Hello

    I guess the recovery procedure has recreated the E:\ partition and the folder you are looking for is no longer exists.  As you probably know, D:\ and E:\ partitions may not be changed.

    If you want to check, a utility to find files, folders, etc is called Commander free of charge, on the link below.  It displays the files that the operating system normally hides and has a search function.

    http://www.SnapFiles.com/PHP/download.php?id=107872&a=7122339&tag=601108&loc=10

    It is a zipped file.  If you do not have an extraction utility installed, download and install 7-Zip , which can be used to open it so that you can run the Setup program.  Run the program and select the drive E:\ in the toolbar to display the content.

    Best wishes

    DP - K

  • Problem with image extract the content and the tile at the same time show on ListField

    My application is Application News get JSON webservice to appear on ListField.

    On each line in the list, it will show you the image thumbnail, title and Teaser as below.

    _______________________________________

    |                |                       Title

    |   Thumb  |_______________________________

    |_______  |                       Teaser

    First of all, I have to get JSON that contains the url of the thumbnail image, title and Teaser.


    I managed to view the title and Teaser, but the thumbnail is not. When I Fetch image with the url of the thumbnail image, it returns only bitmap = null for me.

    My method is first call httpdispatcher to get the thumbnail image, title and Teaser and then wait and call another httpdispatcher to retrieve the url of the image thumbnail, then added to listfield.

    Here is my code

    Class helloScreen{
    
    public void requestSucceeded(byte[] result, String contentType)   {      if (contentType.equals("image/png") ||        contentType.equals("image/jpeg") || contentType.equals("image/gif") ||contentType.equals("image/jpg")) {         bitmap_temp = Bitmap.createBitmapFromBytes(result, 0, result.length, 1);                     synchronized (UiApplication.getEventLock()) {
    
                   }         }         else if (contentType.startsWith("text/")) {
    
                  strResult = new String(result);
    
                 try {                     ja = new JSONArray(strResult);
    
                  } catch (JSONException e) {                   // TODO Auto-generated catch block                    e.printStackTrace();              }
    
               synchronized (UiApplication.getEventLock()) {
                                  int temp_int_next=0;
                    try {
                        callback.erase();
                         for(int x=0;x<10;x++){
    
                             j = (JSONObject) ja.get(x);
    
     String get_htmlOff_first = j.get("teaser").toString().substring(j.get("teaser").toString().indexOf(">")+1);
     final String thumb = replace(j.get("thumb").toString(),"files/","http://www.eng.chula.ac.th/files/");
    
                                    UiApplication.getUiApplication().invokeAndWait(new Runnable() {
    
                                    public void run() {
    
                           getImageURL(thumb); 
    
                                 }});                      
    
    callback.insert(j.get("title")+" ", ""+get_htmlOff_first.trim(), bitmap_temp , temp_int_next , "Event");                      temp_int_next++;
    
                      }
    
                       } catch (JSONException e) {                  // TODO Auto-generated catch block                    e.printStackTrace();              }               
    
                }         }         else {            synchronized (UiApplication.getEventLock()) {         Dialog.alert("Unknown content type: " + contentType);         }         }
    
    
    
    public void getImageURL(String url) {                HttpRequestDispatcher dispatcher2 = new HttpRequestDispatcher(url,                "GET", this);    }
    

    }

    httpRequest, class Dispatcher is used to get the data from the url

    public HttpRequestDispatcher(String url, String method, helloScreen screen)
    {
    this.url = url;
    this.method = method;
    this.screen = screen;
    
    }
    
    public String getType(){
    
        return type;
    
    }
    
    public void run() {
        try {
    
            if(WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED)
           {
                connection = (HttpConnection)Connector.open(url+";interface=wifi");
         }else{
    
            String uid = getWap2Uid();
            connection = (HttpConnection)Connector.open(url+";deviceside=true;ConnectionUID=" + uid);
    
            }
    
        connection.setRequestMethod(method);
    
        connection.setRequestProperty("Accept","text/html, image/jpg, image/jpeg, image/,image/gif");
    
        int responseCode = connection.getResponseCode();
        if (responseCode != HttpConnection.HTTP_OK) {
        screen.requestFailed("Unexpected response code: " + responseCode);
        connection.close();
        return;
        }
        final String contentType = connection.getHeaderField("Content-type");
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        InputStream responseData = connection.openInputStream();
        byte[] buffer = new byte[10000];
        int bytesRead = responseData.read(buffer);
        while(bytesRead > 0) {
        baos.write(buffer, 0, bytesRead);
        bytesRead = responseData.read(buffer);
        }
        baos.close();
        connection.close();
    
                  UiApplication.getUiApplication().invokeAndWait(new Runnable() {
    
                        public void run() {
    
                            screen.requestSucceeded(baos.toByteArray(), contentType);
    
                        }
    
                        });
    
        } catch (IOException ex) {
        screen.requestFailed(ex.toString());
        }
    }
    

    The point here is that I have JSON and get the url of the thumbnail to fetch before add to listfield. The image should be ready in bitmap_temp but it still get null.

    UiApplication.getUiApplication().invokeAndWait(new Runnable() {
    
                                   public void run() {
    
                           getImageURL(thumb); 
    
                                 }});
    
    public void getImageURL(String url) {                HttpRequestDispatcher dispatcher2 = new HttpRequestDispatcher(url,                "GET", this);    }
    
    callback.insert(j.get("title")+" ", ""+get_htmlOff_first.trim(), bitmap_temp , temp_int_next , "Event");
    

    All day trying to fix it but no success, so I need help from you guys.

    Thank you

    "Is it possible to leave only 1 thread completely pick 10 pictures.

    Yes and this is how I would recommend that do you it this way.  So have a Thread that you give a list of things to do and let it work through each.

  • Extract the value of an xml file (LPX-00601: invalid token)

    Hello

    I have this kind of XML / example...

    declare
        l_clob clob;
        l_xml xmltype;
    
    
    begin
        l_clob := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fu="http://www.fu.gov.si/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soapenv:Body>
            <fu:BusinessPremiseResponse Id="data">
                <fu:Header>
                    <fu:DateTime>2015-10-02T10:56:40.416Z</fu:DateTime>
                    <fu:MessageID>2107C422-FC85-291C-E053-0CC910AC3C4F</fu:MessageID>
                </fu:Header>
                <fu:Error>
                    <fu:ErrorCode>S001</fu:ErrorCode>
                    <fu:ErrorMessage>eriworwiweorioweriorio</fu:ErrorMessage>
                </fu:Error>
            </fu:BusinessPremiseResponse>
        </soapenv:Body>
    </soapenv:Envelope>
    ';
     l_xml := xmltype(l_clob);
      put_xl_line(l_xml.extract('/soapenv:Envelope/soapenv:Body/fu:BusinessPremiseResponse/fu:Error/fu:ErrorCode/text()','xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"').getStringVal());
    
    end;
    

    what I want is to extract the /soapenv:Envelope / soapenv:Body / fu:BusinessPremiseResponse / fu:Error / fu:ErrorCode

    I get this kind of error:

    ORA-31011: XML parsing failed

    ORA-19202: an error has occurred in the processing of XML

    LPX-00601: token not valid in: ' / soapenv:Envelope / soapenv:Body / fu:BusinessPremiseResponse / fu:Error / fu:ErrorCode / text () '

    ORA-06512: at "SYS." XMLTYPE", line 107

    ORA-06512: at line 23

    Thank you

    Hi Peter,.

    What is your version of db?

    EXTRACT and related functions are all deprecated from 11.2.

    Use XMLTABLE or XMLQUERY.

    About the error:

    You have the XPath to the right, but missing the mapping prefix of "fu":

    (l_xml). Extract

    ' / soapenv:Envelope / soapenv:Body / fu:BusinessPremiseResponse / fu:Error / fu:ErrorCode / text () '

    "', ' xmlns:soapenv ="http://schemas.xmlsoap.org/soap/envelope/"

    xmlns:Fu ="http://www.fu.gov.si/" "."

    )

    Example with XMLTABLE:

    declare
      l_clob        clob;
      l_error_code  varchar2(30);
    begin
      l_clob := '
        
            
                
                    2015-10-02T10:56:40.416Z
                    2107C422-FC85-291C-E053-0CC910AC3C4F
                
                
                    S001
                    eriworwiweorioweriorio
                
            
        
    ';
    
      select errorcode
      into l_error_code
      from xmltable(
             xmlnamespaces(
               'http://schemas.xmlsoap.org/soap/envelope/' as "env"
             , default 'http://www.fu.gov.si/'
             )
           , '/env:Envelope/env:Body/BusinessPremiseResponse/Error'
             passing xmlparse(document l_clob)
             columns errorcode varchar2(30) path 'ErrorCode'
           ) ;
    
      dbms_output.put_line(l_error_code);
    
    end;
    /
    
  • extract the contents of the field

    I use ObjectChoiceField & BasicEditField to get some information from the user.  How can I recover the contents of these fields after the user said something?

    I have it!

    Thank you.

  • Extract the contents of the text box

    Hello

    I am trying to automate a process PDFing complex. A single indesign document should appear as several PDFs named, which fall into a number of folders that also have specific names. If I place the PDF names and folders in text boxes on the pasteboard of indesign pages they can be recovered by a script. Do I need to mark the text box, so the script knows where to look, and how this is done?

    Thanks much for any help.

    Hello

    Create a new layer and name it as "printpdf", create a block of text with this layer on each page and fill in the content, as shown in the picture, the first line for the name of the folder and the second row for filaname. The text block should be placed within the page, not the editing table.

    var doc = app.activeDocument;
    var pages = doc.pages;
    var _layer = doc.layers.item("printpdf");
    _layer.printable = false;
    for(var i =0;i
    

    Kind regards

    Cognet

  • How to extract the contents of the div on a single page in div on another page

    Hi all

    I would like to draw the content of the div on the page divs on another page (so that I don't have to update the information on a single page).

    Could someone give me a tip on where to read about what/how to? I don't expect the final answer, just a hint on where to start looking for how get startet.

    Thanks in advance for any answers.

    Best regards

    Ivan

    www.colombiareiser.no

    Try to read on DW Spry html data sets. The Spry HTML data set allows users to use HTML tables standards and other markup, structured as a data source.

    http://labs.Adobe.com/technologies/Spry/articles/html_dataset/index.html

    http://labs.Adobe.com/technologies/Spry/docs.html

    Kind regards

    Vinay

  • Create text online the content of a xml tag frame?

    Hello! I have a pretty big document created from an XML file, and I would like to convert a series of my XML tags to the anchor text blocks, so I can hang them on the left edge of the lines they appear in.

    My XML file is converted into a

    > root

    > Chapter

    > para

    > id

    1

    > verse

    text

    > id

    > verse

    etc... See extract file here http://1drv.ms/1dX6lYO

    So far, I have the following, which gets me an array containing all the elements ID.

    var myDocument = app.activeDocument;
    var myXMLidElement = myDocument.xmlElements.itemByName("book").xmlElements.itemByName("c").xmlElements.itemByName("p").xmlElements.itemByName("id");
    var myXMLidText= (myXMLidElement.contents);
    var myXMLidLength = myXMLidText.length;
    for (var i = 0; i < myXMLidLength; i++) {  //loop to go through
        //alert (myXMLidText[i]);
        myDocument.select(myXMLidText[0]);  //this gives me an error saying expected data type needs to be array. Can someone explain? Where do I find info on the select command?
        myDocument.selection[0].insertionPoints[0].textFrames.add(myXMLidText[0]); //haven't managed to get to this line yet, but I want it to create an inline text frame at the point of the selected text and set the frame's contents to be my XML Id Text
    

    I guess I want and then delete all the text in my id too, but that's not important.

    Some other random excerpts, I could use?

    myInlineFrame.contents = "myXMLidText";
    

    Guidance on the creation of the inline frames and the logic of loop? I'm an old hand with InDesign, but new to scripting, so be gentle.

    Try this,

    var myDocument = app.activeDocument;
    var root = myDocument.xmlElements[0];
    var myXMLidElement = root.evaluateXPathExpression("//book/c/p/id");
    for (var i = 0; i < myXMLidElement.length; i++)
    {
        myDocument.select(myXMLidElement[i]);
        var myTextframe = myXMLidElement[i].placeIntoInlineFrame(["1p","1p"]);
    }
    
  • The analysis of an XML string

    Hi, I wonder if it is possible to skip creating a physics .xml file and parse the XML message I receive directly?

    normally, it takes

    builder.parse(fileConn.openInputStream());
    

    but it is not possible to open an InputStream on a string...

    ByteArrayInputStream built from String.getBytes () [or whatever we call.]

    It implements something like the idea of stringstream c ++.

  • iOS: problem with loading the content of an xml file placed on a server

    So, I have an app that loads a few small things (pictures and text) of a xml/php file on the server. Everything works fine on both android and in the flash debugger, but when I install the ipa file on my iPhone my IOErrorEvent displays an error message. When the xml file and example photos come with the app (they are not on the server, but in the ipa file) everything works perfectly. There is something about iOS that prevents me to load all the data from the server, it seems. There must be a way around it.

    I would be grateful for advice.

    Kind regards

    Array must be table.

Maybe you are looking for

  • Pinnacle studio recognises no firewire port

    FireWire connection? Hi, I have windows xp in my dell vostro 1700, but as I want to capture A / V content in pinnacle studio does not recognize the firewire port, although the port works on Panel and the wire is good too. Could you please someone has

  • Difficulty constant web page does not not and must retrieve page

    Buy dell 7 dial-up connection, hi speed not available, system faster than our XP, with all pages to load and view we get page answers not not and must retrieve page, just get message twice when trying to type this message and lost twice before presen

  • Problems with the email application

    Hello! For some reason my personal e-mail account is accessible to other users in the bed in the email app. If someone else using the computer in my household is logged into his account my own email account is still visible in the application. How to

  • Why the "Mail" is not content box?

    When I try to add content box. It does not appear in the box "add content". Why? 'Mail' should be between 'organization' and 'Profile' content box from view. I rebooted several times.

  • ODI Agent start error

    HelloI installed autonomous agent on the local computer and have trouble from it. Here are the details of the agent.Name: stdalonePort: 20910When executing agent like this D:\Oracle\Middleware\Oracle_ODI_1\oracledi\agent\bin > agent.bat - NAME = stda