Can't read xml with a Reader?

hi,
is it correct that the java Reader classes for reading character streams can't be used for reading XML (in one-pass)?
ie you don't know what encoding to read the file as until you've read the encoding attribute of the top level tag - and by then its too late - you'd have to start again?
(i think this is how xml parsers must work?)
thanks,
asjf

to be honest this was motivated by wanting a quick method to remove the DTD reference from an inputstream, without having to worry about whichever XML API was in use further down in the code (we've since settled on a particular API so this is no longer an issue)
I've been told there are 2 legitimate ways to do this (with the help of the parser)
A) configure the parser (parser-implementation-dependent)
B) in SAX, provide an EntityResolver
Last year I had opted for a gratuitous munge-around by manually reading the inputstream and removing the DTD reference
this year we've started working with chinese documents.. so the code doesn't work since I was using the platform-encoding rather than the xml-declared encoding
its pretty clear that (B) is the way to go but there are a few other technical hurdles to overcome first..
i'm beginning to think that /all/ quick-workarounds come back to bite you soon enough..

Similar Messages

  • How can I read pdf with ebook reader on JounE touch

    How can I read pdf with ebook reader and where could I put the pdf in Journe

    Hi there
    You said that you want to read pdf with ebook reader .
    For me ,i usually read the pdf files using another pdf reader which supports to read the pdf files directly.
    And i am now just using their free trial.
    You can also have a try.
    +Message was edited: Advert has been removed+

  • Replace AI read.vi with DAQmx read.vi

    Hi,
    I'm trying to replace AI read.vi with DAQmx Read.vi. The old VI, "AI read.vi", is returning two data: 'scaled data' and 'binary data'. However, the new DAQmx read.VI has only one output. Can anyone tell me how to get both data in new DAQmx read.vi?
    Thank you for your support.
    Best,
    Jay  
    Attachments:
    POT9.230.VI ‏252 KB

    duplicate thread
    Stick to your original!

  • Reading xml with streamtokenizer

    Does anyone know how to read xml tags (everthing in between < & >) with streamtokenizer, I can't find any tutorials.

    I recommend xml packages. It's a bit more complex, IMO.

  • Confirmation That I Understand What I Can and Cannot Do With Adobe Reader XI and Adobe Acrobat Pro XI

    I am new to working with Adobe Acrobat Pro XI and Adobe Reader XI.  Based on research I have done and questions answered in the Adobe Communities and Forum, I wanted to make sure I understand the limitations of these two products before I report back to my supervisor.  (We do not want to use XFA forms to obtain data in an xml file.)
    1.  Adobe Reader XI will allow a user to save a fillable PDF document to his/her local PC.  But it is only possible to save it as a PDF.
    2.  Adobe Reader XI will not allow a user to export the data in a fillable PDF into an xml file (unless you purchase the LiveCycle Reader Extensions license).
    3.  Adobe Reader XI will not allow a PDF file to be displayed in a .NET program unless the "Enable Protected Mode at startup" checkbox in Preferences/Security(Enhanced) has been unchecked.  (The previous version of Reader would allow this without disabling security.)
    4.  Adobe Acrobat Pro XI will allow a user to scan a form and create a fillable PDF.
    5.  Adobe Acrobat Pro XI will allow a user to save the fillable form as a PDF or XML.  However, it is the form that is being saved as an XML file.  Not the data.
    6.  Adobe Acrobat Pro XI will allow a user to export the data of a form into an xml file, an .fdf file, an .xfdf file, or a .txt file.
    7.  If a programmer writes a program in .NET to save the data of a PDF as an .xfdf file using IAC code, it will only work on a PC that has Adobe Acrobat (Standard or Pro).  If we need this executable to work on other PCs, we would need to purchase additional licenses of Adobe Acrobat - a license for every PC that needs to run the executable.
    8.  If a programmer writes  JavaScript code using trusted functions to get around security issues, that code will work on a PC that has Adobe Acrobat (Standard or Pro) but will not work on Adobe Reader XI.  Again, if we wanted our JavaScript to work, we would need to purchase Adobe Acrobat for every PC that would run the code.
    Please let me know if I have understood all of this correctly.  Thank you.

    Thank you for your comments to each of my statements, Irosenth.  That has been extremely helpful.
    I probably needed more of an explanation on statement #3.  I wrote a .NET program that used this line:   "Process.Start("AcroRd32", FilePath)" and when I ran the executable on a desktop PC that only had Adobe Reader XI on it, Reader would not open unless we unchecked the "Enable Protected Mode at startup" box.  I researched this and found several references to this being a problem in Readers since Reader 9.  I just wanted to make sure this was correct.  One article indicated that we could change the security setting within the registry using code and then change it back.
    Item #8 needed more information as well.  I had tried to use the "exportAsXFDF()" in a trusted function and it would never work in Reader.  It has an "F" in the availability column of the "Quick Bar" in the JavaScript API Reference which means it requires "forms rights".  I saw that; but it was not clear to me if that meant that a trusted function would work.  So, it looks like trusted functions will not get around security settings if forms rights are required.

  • I can't open pdf with adobe reader

    I had to download Adobe reader to open a PDF.
    Now I can't open the PDF and get a message that I must accept Adobe conditions forst which I did when installing it.
    I notice that it is a problem across different platforms all with Adobe reader.
    Any solutions?
    Thanks

    Open a Finder window then from the menu bar click Go > Go to Folder
    Type or copy paste the following:
    /Library/Internet Plug-Ins
    Click Go.
    If you see the:  AdobePDFViewer plugin in the Internet Plug-Ins folder, move it to the trash.
    Restart your Mac and try opening a PDF file.

  • My free Acrobat trial expired and now I can't open PDFs with Adobe Reader

    I recently downloaded a free trial of Adobe Acrobat Pro before purchasing the software.  I already have Adobe reader installed on my computer (Dell PC -- Windows 7).  I attempted to purchase Adobe Acrobat as the parent of a student and I was told I had to wait for verification, which could take 1-2 days.  In the mean time, EVERY time I try to open a PDF, it asks me to buy the software and reminds me my trial has expired.  How can I revert back to using the free Adobe Reader I have always used?  If I had known it would be this much trouble, I never would have tried the free trial!  Can anyone help me out?
    Thank you!!
    MrsJessP

    Open Adobe Reader | Edit | Preferences | General: use the Select Default PDF Handler to specify Adobe Reader instead of Acrobat.

  • Can't open forms with Adobe Reader X

    I'm running Windows Vista Business and after installing Adobe reader X. It will no longer opens forms.  The program simply quits responding.  Tried installing it on a Windows 7 computer and it works fine.  Any help besides reverting back to Reader 9.4.1 

    I found an issue with the new security features in this version of Reader. If you go to Edit>Preferences>General and uncheck "Enable procted mode at startup." You will get a pop-up warning that you will need to manually restart Adobe Reader.  Restart the reader and the problem seems to be resolved "for now"

  • UNIX 'read' conflicting with Myclass:read()

    Hello!
    I'm cretaing a class FileChannel, qith a method called read. This mehod has the prototype:
    int read(Buffer& buffer, int offset =0);And the implementation is like this:
    int FileChannel::read(Buffer& buf, int offset){
         ssize_t howmanyQ = read( this->fileDescriptor, (buf.data()+offset), (size_t)buf.capacity()-offset);
         return howmanyQ;
    }The compiler throws me this error(GCC 4.1):
    ../FileChannel.cpp: In member function �virtual int raxIO::FileChannel::read(raxIO::Buffer&, int)�:
    ../FileChannel.cpp:29: error: pointer of type �void *� used in arithmetic
    ../FileChannel.cpp:29: error: no matching function for call to �raxIO::FileChannel::read(int&, void*, unsigned int)�
    ../FileChannel.cpp:27: note: candidates are: virtual int raxIO::FileChannel::read(raxIO::Buffer&, int)
    ../FileChannel.hpp:31: note: virtual int raxIO::FileChannel::read(raxIO::Buffer&, int, int)
    ../FileChannel.hpp:32: note: virtual int raxIO::FileChannel::read(void*, int)
    make: *** [FileChannel.o] Error 1
    The include files at the beginning of my .cpp file are:
    #include "FileChannel.hpp"
    #include <sys/types.h>
    #include <sys/uio.h>
    #include <unistd.h>
    How can I solve this? :S Hlp Please
    Edited by: RaulHuertas on Apr 7, 2008 1:34 PM

    You haven't shown all the declarations that would affect whether the code is correct, nor shown which line numbers apply to the portion of source code that you supplied, so I can't provide a detailed answer. But I can make these observations, assuming line 29 is this one ssize_t howmanyQ = read( this->fileDescriptor, (buf.data()+offset), (size_t)buf.capacity()-offset);line 29, �void *� used in arithmetic:
    Apparently you have declared Buffer::data() to return void*, and are trying to add an offset to the return value. That operation is not valid. If p is pointer type, p+1 means adding sizeof(*p) bytes to the address that p points to. Since sizeof(void) has no meaning, the operation is not valid. Probably Buffer::data() should return a type like char* or unsigned char*, but I can't say without seeing the design for class Buffer.
    Note: Some compilers allow using void* in pointer arithmetic as a non-standard extension. Such code violates the C++ language standard, and you should not write code that depends on such an extension.
    line 29, no matching function:
    The call to read in function FIleChannel::read will try to call one of the overloaded "read" functions declared in FileChannel, which is probably not what you intended. Fortunately, none of the FileChannel::read functions has a matching parameter list, so the call failed at compile time instead giving a bizarre result or crashing at run time.
    - If you meant the system call "read", you have to qualify the name to show you mean the one at global scope. If that is the case, write the name as ::read.
    - If you meant some other function, use its fully-qualified name.
    - If you actually meant to call one of the other FileChannel::read functions, you have to supply a set of arguments that matches the parameter list of one of them.

  • Read XML with different schema definitions

    Hello,
    I have an XML stored in a table as XMLTYPE and I have no problem to read the first part (ELMAHeader)
    WITH t AS(
    SELECT XMLTYPE(
    q'[<?xml version = '1.0' encoding = 'UTF-8'?>
    <ELMAKM xsi:noNamespaceSchemaLocation="./KM/01.00/ELMAKM_000001.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:km="http://www.zivit.de/KiStA/KiStAM/V1.0/KiStA-KiStAM-Anfrage">
       <ELMAKOM>
          <ELMAHeader ELMAKMVersion="1">
             <AuthSteuernummer>BG</AuthSteuernummer>
             <AccountID>11</AccountID>
             <KundeneigeneID>1</KundeneigeneID>
             <Verarbeitungslauf>PROD</Verarbeitungslauf>
             <ErstellungsDatum>2014-09-16</ErstellungsDatum>
             <ErstellungsZeit>11:00:27.7</ErstellungsZeit>
          </ELMAHeader>
          <ELMAVerfahren>
             <KISTA_KM_ANTW UUID="0345" OrdBegriff="SLD"
             xsi:schemaLocation="http://www.zivit.de/KiStA/KM/01.00-r000001 ./KM/01.00/ELMAKM_KISTA_000001.xsd"
             xmlns="http://www.zivit.de/KiStA/KM/01.00-r000001"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:k="http://www.zivit.de/KiStA/Std/01.00-r000001">
                <KiStAV_DL Zulassungsnummer="2"/>
                <KiStAV Zulassungsnummer="2" Name="SLD"/>
                <Antwort xsi:type="AntwortArt3" UUID="0f" KdOrdBegriff="4">
                   <ReturnCode>1</ReturnCode>
                   <Anlass Datum="2014-08-11" Grund="1"/>
                   <PersAngabe>
                      <Person>
                         <k:NName>B</k:NName>
                         <k:VName>Y</k:VName>
                         <k:GebDt>1944-10-11</k:GebDt>
                      </Person>
                      <Adresse xsi:type="k:InlandsAdresse">
                         <k:Str>A-Str.</k:Str>
                         <k:HausNr>5</k:HausNr>
                         <k:Ort>M</k:Ort>
                         <k:Plz>8</k:Plz>
                      </Adresse>
                   </PersAngabe>
                </Antwort>
             </KISTA_KM_ANTW>
          </ELMAVerfahren>
       </ELMAKOM>
    </ELMAKM>]') x FROM dual
    SELECT  x
           ,elma.ELMAKMVersion
           ,elma.AuthSteuernummer
           ,elma.AccountID
           ,elma.KundeneigeneID
    FROM    t
           ,XMLTABLE(
                '/ELMAKM/ELMAKOM/ELMAHeader'
                PASSING t.x
                COLUMNS ELMAKMVersion       VARCHAR2(8)     PATH '@ELMAKMVersion'
                       ,AuthSteuernummer    VARCHAR2(10)    PATH 'AuthSteuernummer'
                       ,AccountID           VARCHAR2(10)    PATH 'AccountID'
                       ,KundeneigeneID      VARCHAR2(10)    PATH 'KundeneigeneID'
                ) elma
    But how can I read the second part(ELMAVerfahren)? I tried many selects but I get no results, e.g.
    WITH ...
    SELECT  x
           ,elma.UUID
    FROM    t
           ,XMLTABLE(
                XMLNAMESPACES(
                    DEFAULT './KM/01.00/ELMAKM_KISTA_000001.xsd'
                    ,'http://www.zivit.de/KiStA/KiStAM/V1.0/KiStA-KiStAM-Anfrage' AS "km"
                    ,'http://www.zivit.de/KiStA/Std/01.00-r000001' AS "k"
                '/ELMAKM/ELMAKOM/ELMAVerfahren/KISTA_KM_ANTW'
                PASSING t.x
                COLUMNS UUID       VARCHAR2(8)     PATH '@UUID'
                ) elma
    DB version
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    Regards
    Marcus

    Hi Marcus,
    If you declare a default namespace using the XMLNamespaces clause, it'll apply to all unqualified elements referenced by the XQuery expression.
    In your attempt, ELMAKM, ELMAKOM and ELMAVerfahren are treated as being part of the default namespace, which is wrong since those nodes are in no namespace.
    To handle this kind of situations, where there are default namespace redefinitions down the tree, you have to declare a prefix :
    SELECT  x 
           ,elma.UUID 
    FROM    t 
           ,XMLTABLE(
               XMLNamespaces('http://www.zivit.de/KiStA/KM/01.00-r000001' as "ns0") 
            ,  '/ELMAKM/ELMAKOM/ELMAVerfahren/ns0:KISTA_KM_ANTW' 
                PASSING t.x 
                COLUMNS UUID       VARCHAR2(8)     PATH '@UUID' 
                ) elma

  • I have a pdf that i can not get to print and I can only open it with Adobe Reader.

    I have a pdf that will only open in Adobe Reader.  I need to print it but when I try, I keep getting the message "Before you can preform .....you must install a printer."  I have several printers networked to this machine.  They all have up to date drivers.  I've tried changed the default printer.  I must print this document and am getting very frustrated.  I am on a Windows 7 PC.

    Hello,
    In order to troubleshoot the Adobe Reader printing issues, please refer to the following link:- Troubleshoot PDF printing | Acrobat, Reader.
    Regards,
    Nakul

  • Can't open pdf with Adobe reader 11.0

    2009 24" iMac G5 OSX 10.8.2
    After downloading pdfs, even Apple's iPhone manual and saving it to my hard drive, I cannot reopen it. The Adobe Reader error message says that the file is damaged and cannot be opened. I tried reinstalling 11.0 but to to no avail. The adobe site offered this link to their forum:
    http://forums.adobe.com/message/1781038
    Anybody with a similar problem. I'd greatly appreciate any ideas on how to resolve this.
    Thx,
    Terriershep.

    It sounds like that you downloaded the PDF in Safari and tried to open it later. The fix is to delete the Adobe plugins from your Library's Internet-Plugins folder or to use another browser, not Safari, to download your PDFs.

  • Can't open pdfs with adobe reader 11

    I was directed to download adobe reader 11, but am now unable to open any pdfs. I am using OSX version 10.7.5 and using safari. Previously I had no problem with viewing pdfs. I tried downloading again, but get a message that it is already downloaded. Any suggestions?

    I face the same issue, tired downloading on both Mac and Ubuntu, but unable to open a pdf doc, it keep saying cannot find adobe reader, please help.
    Thank you
    Syed Ahmed
    www.bigbolo.com

  • Can't print PDF with Adobe Reader 10.1.12 and Mac OS 10.7.5

    I can print other things from this computer to my printer but not PDFs. Have been able to for years but not now. "Print as image" works but print quality too low.
    Using HP Laser Jet P3005dn
    Very frustrating. Have not gotten anything from apple, HP, or adobe communities.

    Went back to HP.com and this time was able to see and download latest driver and firmware for HP LaserJet P3005dn  Installation of new firmware was done thru the HP Printer Utility application on my iMac OS 10.7.5
    I was able to choose my printer and then upload the firmware file from the iMac to the printer. This has completely solved the problem!
    Thank you ~graffiti Not sure why I was not able to access the driver and firmware earlier from the HP site but eventually I found it.

  • Can't encrypt files with fingerprint reader

    I just bought a Toshiba E105-s1602 and I cant figure out how to encrypt files and folders with the fingerprint reader.
    I use it to log onto the computer and in the instructions it says just to right click on the file and there should be something that says encrypt or something similar, but I have no options having to do with encryption.
    Does anybody know how to use this, am I doing something wrong?
    Thanks

    As far as I know this option depends on preinstalled software. I am not 100% sure but Toshiba offers two different applications for this purposes.
    If such option is not available then this option is not offered by preinstalled application.

Maybe you are looking for

  • OTC ssl.conf file does not have ssl wallet file location details

    Hi B2B Gurus, While doing the HTTPS configuration in OTC we observed that some of lines were missing in ssl.conf file located at <Oracle_Home>\Apache\Apache\conf. The below mentioned lines are missing in OTC’s ssl.conf but present in OracleB2B’s ssl.

  • Windows Vista laptop to Time Machine Airport wireless connection "Limited"

    Hey everyone, sorry about this issue, as its most likely a simple fix. Being an apple user of 20 years I have never owned a PC, long story short, a new guest in my home has a windows laptop that is running Vista, and is only connecting to my Time Cap

  • Photoshop 13.0.6 on mac osx 10.9.5 with AD accounts

    Hi, I take care of 35 imacs at a school and photoshop is often freezing. The students login with their active directory accounts and work with files LOCALLY. Do you know if this setup causes problems? By the way, I was running a setup from a few year

  • Total disk size in mb!

    Hi, I am writing a script to get information on disks for Solaris 10, does anyone know of a way to print out the size of each disk on the system in MB i know how to get it in GB and could do some number manipulation however it would be better if I co

  • ISE 14.7 Evaluation License... Problems supporting specific Virtex-5 device...

    Good afternoon... I'm trying to evaluate ISE 14.7 as an alternative to a very aged version of ISE that is being used to support a legacy design.  The design uses a Virtex-5 (xc5vfx100t).  Synthesis fails when platgen blows up declaring that there is