• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic