@Beta protected void readFrom(InputStream is) throws IOException { try { XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); //Removing root element options.setLoadReplaceDocumentElement(null); ctPivotCache = CTPivotCache.Factory.parse(is, options); } catch (XmlException e) { throw new IOException(e.getLocalizedMessage()); } }
@Beta public void readFrom(InputStream is) throws IOException { try { XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); //Removing root element options.setLoadReplaceDocumentElement(null); pivotTableDefinition = CTPivotTableDefinition.Factory.parse(is, options); } catch (XmlException e) { throw new IOException(e.getLocalizedMessage()); } }
@Beta public void readFrom(InputStream is) throws IOException { try { XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); //Removing root element options.setLoadReplaceDocumentElement(null); ctPivotCacheDefinition = CTPivotCacheDefinition.Factory.parse(is, options); } catch (XmlException e) { throw new IOException(e.getLocalizedMessage(), e); } }
@Beta protected void readFrom(InputStream is) throws IOException { try { XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); //Removing root element options.setLoadReplaceDocumentElement(null); ctPivotCacheRecords = CTPivotCacheRecords.Factory.parse(is, options); } catch (XmlException e) { throw new IOException(e.getLocalizedMessage()); } }
/** * Construct a SpreadsheetML drawing from a package part * * @param part * the package part holding the drawing data, the content type * must be * <code>application/vnd.openxmlformats-officedocument.drawing+xml</code> * * @since POI 3.14-Beta1 */ public XSSFDrawing(PackagePart part) throws IOException, XmlException { super(part); XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); // Removing root element options.setLoadReplaceDocumentElement(null); InputStream is = part.getInputStream(); try { drawing = CTDrawing.Factory.parse(is, options); } finally { is.close(); } }
@Beta public void readFrom(InputStream is) throws IOException { try { XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); //Removing root element options.setLoadReplaceDocumentElement(null); ctPivotCacheDefinition = CTPivotCacheDefinition.Factory.parse(is, options); } catch (XmlException e) { throw new IOException(e.getLocalizedMessage(), e); } }
@Beta protected void readFrom(InputStream is) throws IOException { try { XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); //Removing root element options.setLoadReplaceDocumentElement(null); ctPivotCache = CTPivotCache.Factory.parse(is, options); } catch (XmlException e) { throw new IOException(e.getLocalizedMessage()); } }
@Beta public void readFrom(InputStream is) throws IOException { try { XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); //Removing root element options.setLoadReplaceDocumentElement(null); pivotTableDefinition = CTPivotTableDefinition.Factory.parse(is, options); } catch (XmlException e) { throw new IOException(e.getLocalizedMessage()); } }
@Beta protected void readFrom(InputStream is) throws IOException { try { XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); //Removing root element options.setLoadReplaceDocumentElement(null); ctPivotCacheRecords = CTPivotCacheRecords.Factory.parse(is, options); } catch (XmlException e) { throw new IOException(e.getLocalizedMessage()); } }
/** * Construct a SpreadsheetML drawing from a package part * * @param part * the package part holding the drawing data, the content type * must be * <code>application/vnd.openxmlformats-officedocument.drawing+xml</code> * * @since POI 3.14-Beta1 */ public XSSFDrawing(PackagePart part) throws IOException, XmlException { super(part); XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); // Removing root element options.setLoadReplaceDocumentElement(null); InputStream is = part.getInputStream(); try { drawing = CTDrawing.Factory.parse(is, options); } finally { is.close(); } }
/** * Construct a SpreadsheetML drawing from a package part * * @param part the package part holding the drawing data, * the content type must be <code>application/vnd.openxmlformats-officedocument.drawing+xml</code> * @param rel the package relationship holding this drawing, * the relationship type must be http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing */ protected XSSFDrawing(PackagePart part, PackageRelationship rel) throws IOException, XmlException { super(part, rel); XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); //Removing root element options.setLoadReplaceDocumentElement(null); drawing = CTDrawing.Factory.parse(part.getInputStream(),options); }
/** * {@inheritDoc} */ public GuaranteeTermStateType[] getGuaranteeTermStates() throws ResourceUnavailableException { try { Element body = XmlUtils.createElement( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_QNAME, "wsag:GuaranteeTermState" ); body.setAttribute( WsagConstants.WSAG_PREFIX_DECLARATION, WsagConstants.NAMESPACE_URI ); Element response = client.invoke( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_ACTION, body ); AgreementStatePropertiesType props = AgreementStatePropertiesType.Factory.parse( response, new XmlOptions().setLoadReplaceDocumentElement( null ) ); GuaranteeTermStateType[] states = props.getGuaranteeTermStateArray(); return states; } catch ( SoapFault e ) { throw new ResourceUnavailableException( e ); } catch ( XmlException e ) { throw new ResourceUnavailableException( e ); } }
private List<Plugin> extractPluginsFromFile(URL pluginsFile) { List<Plugin> result = new ArrayList<Plugin>(); PluginsDocument pluginsDoc; try { XmlOptions xmlOptions = makeXMLOptions(); xmlOptions.setLoadReplaceDocumentElement(new QName(PLUGINS_NS, "plugins")); pluginsDoc = PluginsDocument.Factory.parse(pluginsFile, xmlOptions); } catch (FileNotFoundException ex) { logger.debug("Could not find " + pluginsFile); return result; } catch (XmlException e1) { logger.error("Error parsing " + pluginsFile, e1); return result; } catch (IOException e1) { logger.warn("Error reading " + pluginsFile, e1); return result; } if (pluginsDoc.getPlugins().getPluginArray() != null) { for (DescribedPlugin pluginDescr : pluginsDoc.getPlugins() .getPluginArray()) { Plugin plugin = Plugin.fromXmlBean(pluginDescr); result.add(plugin); } } return result; }
/** * {@inheritDoc} */ public String getName() throws ResourceUnavailableException { try { Element body = XmlUtils.createElement( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_QNAME, "wsag:Name" ); body.setAttribute( WsagConstants.WSAG_PREFIX_DECLARATION, WsagConstants.NAMESPACE_URI ); Element response = client.invoke( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_ACTION, body ); XmlNCName respDoc = XmlNCName.Factory.parse( response, new XmlOptions().setLoadReplaceDocumentElement( null ) ); return respDoc.getStringValue(); } catch ( SoapFault e ) { throw new ResourceUnavailableException( e ); } catch ( XmlException e ) { throw new ResourceUnavailableException( e ); } }
/** * {@inheritDoc} */ public AgreementContextType getContext() throws ResourceUnavailableException { try { Element body = XmlUtils.createElement( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_QNAME, "wsag:Context" ); body.setAttribute( WsagConstants.WSAG_PREFIX_DECLARATION, WsagConstants.NAMESPACE_URI ); Element response = client.invoke( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_ACTION, body ); AgreementContextType respDoc = AgreementContextType.Factory.parse( XmlUtils.getFirstElement( response ), new XmlOptions().setLoadReplaceDocumentElement( null ) ); return respDoc; } catch ( SoapFault e ) { throw new ResourceUnavailableException( e ); } catch ( XmlException e ) { throw new ResourceUnavailableException( e ); } }
/** * {@inheritDoc} */ public String getAgreementId() throws ResourceUnavailableException { try { Element body = XmlUtils.createElement( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_QNAME, "wsag:AgreementId" ); body.setAttribute( WsagConstants.WSAG_PREFIX_DECLARATION, WsagConstants.NAMESPACE_URI ); Element response = client.invoke( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_ACTION, body ); AgreementIdDocument id = AgreementIdDocument.Factory.parse( response, new XmlOptions().setLoadReplaceDocumentElement( null ) ); return id.getAgreementId(); } catch ( SoapFault e ) { throw new ResourceUnavailableException( e ); } catch ( XmlException e ) { throw new ResourceUnavailableException( e ); } }
/** * {@inheritDoc} */ public TermTreeType getTerms() throws ResourceUnavailableException { try { Element body = XmlUtils.createElement( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_QNAME, "wsag:Terms" ); body.setAttribute( WsagConstants.WSAG_PREFIX_DECLARATION, WsagConstants.NAMESPACE_URI ); Element response = client.invoke( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_ACTION, body ); TermTreeType respDoc = TermTreeType.Factory.parse( XmlUtils.getFirstElement( response ), new XmlOptions().setLoadReplaceDocumentElement( null ) ); return respDoc; } catch ( SoapFault e ) { throw new ResourceUnavailableException( e ); } catch ( XmlException e ) { throw new ResourceUnavailableException( e ); } }
/** * {@inheritDoc} */ public ServiceTermStateType[] getServiceTermStates() throws ResourceUnavailableException { try { Element body = XmlUtils.createElement( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_QNAME, "wsag:ServiceTermState" ); body.setAttribute( WsagConstants.WSAG_PREFIX_DECLARATION, WsagConstants.NAMESPACE_URI ); Element response = client.invoke( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_ACTION, body ); AgreementStatePropertiesType props = AgreementStatePropertiesType.Factory.parse( response, new XmlOptions().setLoadReplaceDocumentElement( null ) ); ServiceTermStateType[] states = props.getServiceTermStateArray(); return states; } catch ( SoapFault e ) { throw new ResourceUnavailableException( e ); } catch ( XmlException e ) { throw new ResourceUnavailableException( e ); } }
/** * {@inheritDoc} */ public AgreementTemplateType[] getNegotiableTemplates() throws ResourceUnknownException, ResourceUnavailableException { try { Element body = XmlUtils.createElement( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_QNAME, WsagConstants.WSAG_NEGOTIATION_PREFIX + ":" + "NegotiableTemplate" ); body.setAttribute( WsagConstants.WSAG_NEGOTIATION_PREFIX_DECLARATION, WsagConstants.WSAG_NEGOTIATION_NAMESPACE_URI ); Element response = client.invoke( WsagConstants.WSRF_GET_RESOURCE_PROPERTY_ACTION, body ); NegotiationPropertiesType props = NegotiationPropertiesType.Factory.parse( response, new XmlOptions().setLoadReplaceDocumentElement( null ) ); return props.getNegotiableTemplateArray(); } catch ( SoapFault e ) { handleSoapFault( e ); throw new ResourceUnavailableException( e ); } catch ( XmlException e ) { throw new ResourceUnavailableException( e ); } }
new XmlOptions().setLoadReplaceDocumentElement( null ) ); counterOffers = ( output.getNegotiationCounterOfferArray() == null ) ? new NegotiationOfferType[0]