Who's right - JDK 1.6 stax or WoodStox?

Hi all...
I have a serious problem with switching between aforementioned technologies and I'm confused which one works properly. My case is easy - I have XML that starts like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE field-specification SYSTEM "http://xxx/dtd/field-specification.dtd">And I have following naive code:
XMLInputFactory xmlif = XMLInputFactory.newInstance();
XMLStreamReader reader = xmlif.createXMLStreamReader(sourceReader);Now using WoodStox it ends like:
com.ctc.wstx.exc.WstxIOException: xxx
     at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:650)
     at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1071)
     at sk.bgs.swift.XMLUtils.prepareXmlReader(XMLUtils.java:159)
Caused by: java.net.UnknownHostException: xxxAnd I need following line to tell WoodStox "please, ignore that DTD":
xmlif.setProperty(XMLInputFactory.SUPPORT_DTD, false);Now it works... if I switch to JDK 1.6, it works. If I drop Woodstox from classpath, using JDK 1.6 stax impl it stops to work with:
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,10]
Message: DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.So these versions are mutualy exclusive and I can't just compile it once. Not to mention that running the original example (usable with JDK 1.6 Stax Impl but with Woodstox in classpath) on 1.6 ends with stupid messages:
java.lang.IllegalStateException: Can't overwrite cause
     at java.lang.Throwable.initCause(Throwable.java:320)
     at com.ctc.wstx.compat.Jdk14Impl.setInitCause(Jdk14Impl.java:70)This hardly tells you anything and it's also hard to claim that it is working like on JDK 1.5. ;-) However - here is final version of the code - that works in 1.5 with Woodstox and in 1.6 with both:
XMLInputFactory xmlif = XMLInputFactory.newInstance();
if (xmlif.getClass().getName().equals("com.ctc.wstx.stax.WstxInputFactory")) {
  xmlif.setProperty(XMLInputFactory.SUPPORT_DTD, false);
XMLStreamReader reader = xmlif.createXMLStreamReader(sourceReader);Ok, this is first story... the second one is also interesting. I have line in XML like this:
<prim name="y">[-A-Z0-9.,()/='+:?!"%&amp;*; ]</prim>Now Woodstox has really no problem with it while with JDK 1.6 implementation just doesn't want to eat those entities and I'm pretty out of options how to make THIS working in both implementations. Not to say that I'm not sure which one is right.
But in this second case Woodstox is winner for me from logical point of view. Why is that & interpreted? Why reader.getText() returns only string up to % and stops there? There is no exception in implementation - of course - just my logic stops to work.
Have anyone run into similar problems?
Thanks for any hints and tips how to make such a things work in both cases.
Virgo47

First thing: what does this mean for JDK 1.6? Will it be changed in some update?
Second thing: Yes, I can. ;-)
<prim name="y">[-A-Z0-9.,()/='+:?!"%&amp;*; ]</prim>I have a reader positioned just at the start of the text that is between the tags. Now reader.getText() Woodstox returns the string all way to the last ] included - like expected. Now I'm not really sure if it changes that entity to actual & sign, but that doesn't matter now. Problem with JDK 1.6 is that it returns only string ended with % and when I suggest the reader that I want to read end tag, it fails - because it is not positioned on the </prim> yet.
I don't know which impl is right thou. Woodstox is more logical for me.

Similar Messages

  • Weblogic 10.3.2.0 installation does not pick the right JDK

    The installation does not pick up the right jdk version that is jdk 11.6.0_11 . Although the machine is running the same. Instead it picks up jdk 1.6.0_14. have tested the machine many times. I am Installing Oracle SOA Suite 11g.

    Inside "startWebLogic.sh" file add the JAVA_HOME like following (just below the "setDomainEnv.sh" call):
    JAVA_HOME=C:\bea103\jdk1.6.0_17
    See if this helps.
    Thanks

  • Who's right?

    Hello,
    I was having a look to some documentation.
    In the official "Creative Suite Extension Builder" documentation, in the "Product-specific Guides > InDesign Guide" chapter, I found this:
    Custom menus in InDesign
    The menu items for extensions that you create with Adobe Creative Suite Extension Builder can only be shown in the menu Window > Extensions. If you want to start your extension from another menu, you can do so using an InDesign C++ plug-in. Your C++ menu plug-in must launch your Flash-based extension using the C++ PlugPlug API. To prevent your extension from being displayed in the Window > Extensions menu, remove the menu name from the extension manifest.
    For information on how to create a custom menu placement plug-in and how the plug-in can talk to your extension see the InDesign CS5 SDK (http://www.adobe.com/devnet/indesign/sdk/). .
    Once you have created both the C++ plug-in and Flash-based components of your extension, bundle them together for distribution as a hybrid extension. For details, see the Signing and Packaging Toolkit, which you can download from the Adobe Creative Suite SDK page, http://www.adobe.com/devnet/creativesuite/.
    But, inside the InDesign CS5 SDK, I found this on the "feature-development-with-scripting.pdf" (see page 23):
    Overriding default menu placement
    N O T E : Overriding the default menu position is supported by InDesign, but not yet by other Creative Suite applications.
    By default, CSXS supports a single main menu item, which appears in the application’s Window > Extensions menu. Extension developers may prefer a different menu location. InDesign sup- ports a Menu element and Placement attribute in the manifest.xml that allows an extension to override the default menu position. For example:
    <Menu Placement="'Main:&amp;Window',600.0,'KBSCE Window menu'">FlexUIStroke</Menu>
    The Placement attribute needs to be created with care. See the FlexuUIStroke code for a more precise example (without a line break).
    Strings must be enclosed in single quotes.
    Commas (without white space) are used to separate fields.
    Who's right?
    Thank you,
    Luca

    Well, I have not tried either of those methods myself; but, they do work.
    If all you want to do is place the menu in a custom location, using the InDesign specific menu placement tag is the easiest, best, and recommended solution.
    In the latest SDK update we've included event support for InDesign, Photoshop, and Illustrator. That opens yet one more door for you.
    If your needs are significantly more complex, by that I mean -
    You need fully custom menu structure (such as adding your own menu to the main, with a menu tree under that)
    You need to turn menu items on or off based on application/document state
    You need to create and manage context menus
    Here's how you would go about it:
                mainMenu = InDesign.app.menus.item( "$ID/Main" ).submenus.add( "My Menu" );
                var handler1Action: ScriptMenuAction = InDesign.app.scriptMenuActions.add( "The First Menu" );
                IDScriptingEventAdapter.getInstance().addEventListenerToObject( "onInvoke", myEventHandler, handler1Action )
                var handler1MenuItem: MenuItem = mainMenu.menuItems.add( handler1Action, LocationOptions.AT_END );
            public function myEventHandler( evt: Event = null ): void
                trace( "Menu Event fired" );
    To do context menus, I would suggest looking at Ole's extendscript examples and simply extrapolating that technique to ActionScript and using the IDScriptingEventAdapter for event support.
    Regards
    Bob

  • When backing up using the G Drive on using time machine my wife drops the icon into the trash icon on the loading dock.  I told her this was not correct.  Who is right?  Thanks in Advance.

    Folks,
    I found my wife dropping the icon of her backup file into the trash icon on the dock.  She had just completed using Time machine and when to uninstall the Gdrive.  I told her this was an erroneous practice.  She disagreed.  Who is right?
    Thanks in advance.

    http://www.g-technology.com/kbase/files/G-RAID-Manual-Unmount.pdf
    Hope this helps.

  • Who is Right:  Tomcat or IPlanet?

    As I am reworking the authentication infrastructure for medium sized J2EE application. And I have been writing a simple war to test some strategies.
    My test war uses a simplified servlet controller ala Pet Store. In effort to protect some 'stuff' from being 'called' directily w/o going thru a controller, I installed a security contraint on a URL pattern and its role is set to 'nobody' - which is not a role in our security realm (LDAP).
    Now the proteced URL contains JSPs that are forwared to by the controller, (which is protected but by a different constraint - that does have defined roles in our realm).
    Tomcat (4.0.2) has no problem allowing the controller to do a RequestDispatcher.forward() to a JSP in the protected URL pattern. iAS 6sp3 (Solaris) generates a 'not authorized' error when attempting to forward to a protected URL.
    I guess I am thinking maybe iAS has it right: wether I went to the URL directly or thru a forward - the current login doesn't have privs to access the URL.
    Who is correct? Also, a co-worker has run a similar test on Weblogic 6 and it appears to behave like Tomcat.
    The ultimate objective is to protect the JSPs from direct calls. What might be another strategy? Put them under WEB-INF? Where would one forward to in this setup?
    -Fred

    You need to visit the TalkTalk forum, as this forum is for BT Broadband customers.
    Here is the link.
    The TalkTalk Members Forums
    Openreach are a separate company, and are nothing to do with BT Retail.
    You should be able to get advice on speed issues on the TalkTalk forum, and raise the speed issue with them. They can arrange a visit from Openreach if needed.
    If you are 2KM away from the nearest cabinet, you may simply be on a "faster broadband" type of service.
    As you are only three months into a contract, you would have to wait until it ended, or pay cancellation charges.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • Stable\Right JDK version for today Applet!

    Dear All,
    I have some ideas would like to consult you about :
    I'm building a heavy-applet (for big customer) which uses swing, high-qualitiy image and audio processing and many see & hear technologies.
    Last time we discuss with customer that we will run that applet with JDK 1.4 and later only, after 1 or 2 years running the applet we found out that
    90% of bugs come from 10% users who still using old JDK1.4.xx and JDK1.4.1_xx.
    So should I discuss again with custome that we just support the applet running with JDK1.4.2 and later only.
    I guess 5% of users will not happy for that
    (many reasons : don't want to upgrade to latest JDK, company constraint...),
    - About the plaform (multi-plaform is supported)
    - About the browser (we support all browsers which could allows java plug-in)
    Could you please tell me some good reasons that we should use JDK1.4.2 or later for such applet
    or still support for JDK1.4 and later because ...(your idea)?
    I just would like to find out more information for this case of business.
    Thanks,

    Well, I've to support Java-1.1 and up which is REALLY painful - since 1.1 browsers are typically so buggy that you cannot rely on what the API provides.
    After some time you get a feeling what could work and what does not and you to do your best.
    To benefit from newer APIs introcduced in later versions of java we use reflection, e.g. our applet switches dynamically to VolatileImage-Backbuffer if running on 1.4+, we also have 3 implementations for doing http-connections 1.1, 1.2, J2ME and use our self-written selrialization framework which does not rely on reflection.
    Painful but we get great compatibility.
    lg Clemens

  • Who jarred in jdk 1.4

    I upgraded to jdk 1.4 and now as far I understood, it does not create manifest file automatically. Result: it does not load app. I could not find information on it here on first attempt. Does anybody know how to jar in jdk 1.4 and how to write manifest file? I know that I can find info on how to write manifest file, but now i am not sure that format did not change.
    Also, I noticed that my app.'s working slower after I recompiled it in jdk 1.4, because I have status bar. In 1.3.1 it sequentially processed string consisting of 2-3 thousand char very quick, I hardly could see status bar actually filling. Now, it became visible on strings less than thousand char. Am I paranoid or you had such observation too?

    ??

  • What's the right JDK version for windows vista SP1

    Hello guys,
    I’m trying to install SQL Developer on my old Windows Vista SP1 but as soon as I run it I got a message: Cannot find a J2SE SDK installed at path C:\Program Files\Java\jre6
    I was reading a post and this problem could be solved by installing the JDK. I went to the Java Archive Download website (http://www.oracle.com/technetwork/java/javasebusiness`/downloads/java-archive-downloads-javase6-419409.html) and I downloaded 3 versions but none of them are working. There’re tons of them and I really don’t know which one should be the one to be installed in order to get the SQL Developer working. Any chance someone can help me solve this issue?
    These are the errors I got when I run the installers:
    Jdk-6u26-windows-i586 – error: D: \Java JDK\jdk-6u26-windows-i586.exe is not a valid Win 32 application. Size of the file downloaded: 7140KB
    Jdk-6u26-windows-x64 – error: The version of this file is not compatible with the version of Windows you’re running. Check your computer’s system information to see whether you need an x86 (32-bit) or x64(64-bit) version of the program, and then contact the software publisher. (I was quite careless downloading this version cause I know my computer is 32-bit or x86) size of the file downloaded: 69,043KB
    Jdk-6u37-windows-i586 – error: D: \Java JDK\jdk-6u37-windows-i586.exe is not a valid Win 32 application sizeof the file downloaded: 67,756KB
    Thanks loads

    This one should do it.
    http://download.oracle.com/otn/java/jdk/6u38-b05/jdk-6u38-windows-i586.exe
    I suspect an issue with your download if you are getting the invalid application message

  • Who has rights to change email address

    Who do I email to have my email address for which I have posted a few
    questions changed on this site to the above address.

    You can cancel your own message.
    Depending on the software you are using it may be done differently.
    In outlook express, it's under "Message, Cancel Message."
    The configured email address in your client must match that of the message
    posted in the newsgroup.
    Unfortunately, this may not cancel the message from every system that
    mirrors the Novell forums.
    Craig Wilson - MCNE, MCSE, CCNA
    Novell Support Forums Volunteer Sysop
    Novell does not officially monitor these forums.
    Suggestions/Opinions/Statements made by me are solely my own.
    These thoughts may not be shared either Novell or any rational human.
    "Dan Russo" <[email protected]> wrote in message
    news:Qbh3i.3436$[email protected]..
    > Craig can my question on Jan 25th be removed? I'm being audited for using
    > our company name in my address.
    >

  • ASP suggests alternative part, IBM says they're not compatible - who's right?

    Hi there,
    I've got T60p, recently fan has started to produce some loud noises. I took a look inside, carefully cleaned it up, but no change,I'm pretty sure the fun is just failing.
    The laptop is in warranty, so no problem except I use it quite extensively and prefer the repair to be as quick as possible. I got in touch with an Authorized IBM Service Provider which was willing to replace fan in an hour time. That would mean no mailing  hassle, no weeks long waiting, etc., just great!
    But... (there're always buts?..)
    The laptop type is 2007-8JG, according to the Hardware Maintenance Manual the fan part number is 41W6407. But the Service Provider claims it's not possible anymore to order the 41W6407 (because it's obsolete) and instead they are to order an alternative, compatible one (part number 41V9932).
    I am aware that these numbers are important and tiny differences between parts could result in serious hardware problems. Especially when it comes to cooling systems... And that is why I do prefer to have the one listed in the manual.
    I called IBM Technical Support, the agent was not able to answer the question straight, but promised to discuss it with the engineers and get back to me later. They called me back the same day and the official answer is 'though both parts are very similar they're not compatible'.
    Would you believe the SP in such a situation? 'Instant' repair is a strong temptation...But on the other hand IBM is suppose to know better what's good for their laptops, right?.. So I tend not to believe the Service Provider...
    Any advices?..
    rm
    T60p, 2007-8JG - just amazing piece of engineering!

    rmrmpl, welcome to the forum,
    Having looked at the parts list you need the 41W6407. Other machines are listed against the 41V9932.
    For whatever reason the fans are different; I would believe IBM.
    Andy  ______________________________________
    Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points
    Did you find a post helpfull? You can thank the member by clicking on the star to the left awarding them Kudos Please add your type, model number and OS to your signature, it helps to help you. Forum Search Option T430 2347-G7U W8 x64, Yoga 10 HD+, Tablet 1838-2BG, T61p 6460-67G W7 x64, T43p 2668-G2G XP, T23 2647-9LG XP, plus a few more. FYI Unsolicited Personal Messages will be ignored.
      Deutsche Community     Comunidad en Español    English Community Русскоязычное Сообщество
    PepperonI blog 

  • Who's right and who's wrong as far as battery is concerned??

    There are so many different viewpoints when it comes to taking care of the Mac battery. I just read that "Apple does not recommend leaving your portable plugged in all the time."
    How come so many of you go against Apple's recommendation and think it's best to keep it plugged in all the time whenever possible? I'm very confused about how to take care of the battery.

    Kappy wrote:
    I'm sure in many cases what you say is true. But the "memory" effect has been pretty well documented elsewhere.
    Nickel-cadmium does not like to be pampered by sitting in chargers for days and being used only occasionally for brief periods. A periodic full discharge is so important that, if omitted, large crystals will form on the cell plates (also referred to as memory) and the nickel-cadmium will gradually lose its performance.
    See also This page.
    This is intended for clarification, not criticism.
    I understand there are some serious limitations to NiCad - not the least which is cadmium toxicity. Still - there is no better battery chemistry for things like power tools, where the super-low internal resistance means far better efficiency with high drain devices.
    I just recall that a lot of the calls to fully cycle NiCads on every opportunity might have been misplaced. Batteries simply lose capacity over time, and a good many people saw their gradual loss of capacity as a sign that they were suffering from "the memory effect". Even so, I have a AA/AAA battery charger with a so-called "conditioning" feature which drains the battery down until it reads 1V and then cycles. The manufacturer recommended this step every time for NiCads and once every 10 charges for NiMH. I also have one of their chargers with a "flex pulse" charge algorithm which they claim makes conditioning unnecessary by eliminating crystal formation. I once tried measuring voltage on a charging cell, and it was constantly varying the voltage as it charged.
    However - I'm not sure how critical deep cycling is for ultimate longevity. The ideal situation for battery longevity is to only make use of the center of the charge range - what hybrid car owners call the "Sweet Spot". Something like a Toyota Prius tries to keep the battery range between 40-75% and can go through hundreds of thousands of these smaller cycles, when a traditional cell (using more of the charge range) is rated for 500-1000 cycles.

  • Who is right? Sql 2005 SSMS view of table or INFORMATION_SCHEMA?

    We scripted an old sql 2005 table under Management Studio and got this:
    CREATE TABLE [dbo].[TestTable](
     [myId] [int] IDENTITY(1,1) NOT NULL,
     [Item_#] [char](8) NOT NULL, 
     [Count] [smallint] NOT NULL,
     [ProductName] [char](45) NOT NULL,
     [U_Item_#]  AS (upper([Item_#])),
    Notice that U_Item_# computed column appears in the 5th ordinal position from the top.
    Next I ran this query:
         select table_ProductName, column_ProductName, ordinal_position
         From INFORMATION_SCHEMA.COLUMNS
         where table_ProductName = 'TestTable'
    Results returned:
    table_Name      column_Name       ordinal_position
    TestTable         myId                   1
    TestTable         Item_#                2
    TestTable         U_Item_#            3
    TestTable         Count                   4
    TestTable         ProductName        5
    TestTable         U_ProductName     6
    Notice that  U_Item_# is now in ordinal positon 3 which is not the same as that returned by the script.
    Which  one is to be believed? (SSMS or INFORMATION_SCHEMA.COLUMNS)
    TIA,
    edm2

    This is what I got in SQL Server 2014, same as CREATE TABLE:
    select table_name, column_name, ordinal_position
    From INFORMATION_SCHEMA.COLUMNS
    where table_name = 'TestTable'
    TABLE_NAME COLUMN_NAME ORDINAL_POSITION
    TestTable myId 1
    TestTable Item_# 2
    TestTable Count 3
    TestTable ProductName 4
    TestTable U_Item_# 5
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Can't Connect attendee's who have right Equip/bandwidth

    I have a new g5 able to host multi vid conf's..the 2 people I want to join both have g4's with 1.33mhz...and more than the required 100mbps connection. Only one person has the 3 camera icon indicating he can joing the multi vids conf. Is there a setting we are missing? We all have Ichat AV3.0...and Tiger.
    Please help.

    HI Dj,
    Loss of the Stacked iCons is normally a "Housekeeping" issue where the Cron scripts do not run.
    See here as to Why and links to Utilities Gulliver, "kmosx3: Mac OS X 10.3/10.4: System maintenance", 05:15am Mar 27, 2004 CDT
    Ralph
    EDIT : EZ Jim ??

  • Different complining result between SUN JDK 1.4 and IBM JDK 1.3.1

    Hi! I simplifed my code as following:
    public class TestException2 {
        public Object test() {
            java.sql.Connection cn = null;       
            try {
                 // 1st. close
                cn.close();
            catch (java.sql.SQLException se) {
                 // 2nd. close
                cn.close();
            finally {
                return new Object();
    }But I get different compiling result betwueen SUN JDK 1.4.2 and IBM JDK 1.3.1 (I have to deploied my app to the websphere 5.0)
    In Sun JDK 1.4.2, I only got a warning:
    [e:\work\test]javac TestException2.java
    TestException2.java:14: warning: finally clause cannot complete normally
            ^
    1 warningIn IBM JDK 1.3.1, I got an error:
    TestException2.java:10: unreported exception java.sql.SQLException; must be caught or declared to be
    thrown
                cn.close();
                  ^
    1 errorWhat happend? Who is right?
    Thank you!
    [ I believe the code should not pass the compilation ... ]

    Many other people agree with you, including some Sun engineers.
    Perhaps Sun just feels an obligation to continue to allow it for legacy reasons.
    You might also investigate the compiler that comes with Eclipse.
    http://www.eclipse.org/
    It has a more flexible approach: for some cases, it lets you decide what is a warning and what is an error.

  • How to set up older version of Java JDK?

    I am a Java Developer, and I recently bought a Mac.  I also just started working for a Client who is using JDK 1.6.0_23, and this is not going to change.  The code fails to compile when running through the latest Java 1.6 JDK, so I REALLY need to download and set up JDK 1.6.0_23.  Is this possible?  If I can't get this working, I will unfortunately have to use the Windows machine that the Client gave me.
    Thanks in advance.

    I removed the old program.
    I am using this line in my autoexec.bat
    path = c:\jdk1.3.1_01\bin
    I understand that I don't need to set any classpath. If I am wrong, would this line be correct ?
    classpath = %classpath%;c:\jdk1.3.1_0\bin;c:\jdk1.3.1_01\lib\tools.jar

Maybe you are looking for

  • Error while executing query at a user

    Hello Experts, I am getting error while previewing the query at one of my user ERROR is: Error while connecting the read-only DB user; check that the read only DB user is assigned to database. 110. Help Required !

  • How to set for an asset a mandatory template?

    My problem is, users can create assets and leave template attribute as null. I don´t want that. I want to set template as a mandatory field. I request help.

  • My ipad have wi-fi only  and i need to know who i can go though to get intertnet

    my ipad is wi-fi only and i need to know where i can get internet service

  • Storing audio files in tables

    i need some information about storing audio files. is it possible to store audio files in blob column. in a tbale column data type is blob.in that column is there any possiblity to store audio file.

  • Colour Chooser GUI - Urgent Querie!!

    Hello, Please help! I need to design a �Colour Chooser� using TWO classes(ColourChooser and DrawCanvas) and I need a little help with it. Basically, there are three panels on a frame. 1.     A Canvas 2.     Three JScrollbars (relating to Red Green an