• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Cannot find the constant XMLConstants.ACCESS_EXTERNAL_DTD in JDK 1.6

 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

The following code cannot be compiled in JDK 1.6 but can be compiled in JDK 1.7, do anyone know any other solution with the same function as the code provided which can be compiled in JDK 1.6 ?



Error message:
Caused by: javax.xml.transform.TransformerConfigurationException: [ERR 0337] Cannot set the feature 'http://javax.xml.XMLConstants/property/accessExternalDTD' on this TransformerFactory.
at com.ibm.xtq.xslt.jaxp.AbstractTransformerFactory.setFeature(Unknown Source)
at com.pru.hk.pruone.service.DefaultEAIMQService.doGetXMLDocument(DefaultEAIMQService.java:107)

at com.pru.hk.pruone.service.DefaultEAIMQService.getXMLDocument(DefaultEAIMQService.java:76)

Thanks,
Jack
 
Jack Lau
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I use the code "f.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);" instead of "transFact.setFeature(XMLConstants.ACCESS_EXTERNAL_DTD, false);"? Is it the same purpose to prevent accessing external XML ?


TransformerFactory f = TransformerFactory.newInstance();
f.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
Transformer t = f.newTransformer();
t.transform(xmlSource, result);


Thanks,
Jack
 
This tiny ad is wafer thin:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic