// PermaLinkLccnValidatorUtil perma01 = new PermaLinkLccnValidatorUtil( lccn, authLccnPrefixList, bibLccnPrefixList, masterLccnPrefixList ); // loggerStatic.info("lccnRawMfer:" + perma01.getLccnRawMfer() + ":::"); loggerStatic.info("lccnPadded:" + perma01.getLccnPadded() + ":::"); loggerStatic.info("lccnNoWhiteSpace:" + perma01.getLccnNoWhiteSpace() + ":::"); loggerStatic.info("RECORD TYPE:" + perma01.getRecordType() + ":::"); loggerStatic.info("VALIDATE RESULT:" + perma01.getValidateResult() + ":::"); loggerStatic.info("TRACE MESSAGE:" + perma01.getTraceMessage() + ":::"); =============== /* DOM Object >> Xpath Parse >> Add Values to List Object */ private org.w3c.dom.Document authLccnPrefixXmlDoc = null; private org.w3c.dom.Document bibLccnPrefixXmlDoc = null; //parse Xml Document Objects into Lists public void populateAuthLccnPrefixList02() throws Exception { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance(); javax.xml.xpath.XPath xpath = factory.newXPath(); xpath.setNamespaceContext(this); javax.xml.xpath.XPathExpression expr = xpath.compile("//*[local-name()='row']"); Object result = expr.evaluate(authLccnPrefixXmlDoc, javax.xml.xpath.XPathConstants.NODESET); // org.w3c.dom.NodeList nl = null; org.w3c.dom.Node nd = null; org.w3c.dom.NamedNodeMap nnm = null; org.w3c.dom.Attr atr = null; if(result!=null) { nl = (org.w3c.dom.NodeList)result; logger.debug("nl length: " + nl.getLength() + ":::"); for(int i = 0; i < nl.getLength(); i++) { nd = nl.item(i); nnm = nd.getAttributes(); atr = (org.w3c.dom.Attr)nnm.item(0); authLccnPrefixList.add(atr.getValue()); }//end for }//end if } /* Xml File to DOM Object >> Xpath Parse >> Add Values to List Object */ private String authLccnLocalFileUrlString = "http://rs5.loc.gov/xmlcommon/eadwork/mfer_files/zz_permalink_tst/authLCCNPrefixes.xml"; private String bibLccnLocalFileUrlString = "http://rs5.loc.gov/xmlcommon/eadwork/mfer_files/zz_permalink_tst/bibLCCNPrefixes.xml"; public void populateAuthLccnPrefixList() throws Exception { javax.xml.parsers.DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); domFactory.setNamespaceAware(true); // never forget this! javax.xml.parsers.DocumentBuilder builder = domFactory.newDocumentBuilder(); org.w3c.dom.Document doc = builder.parse((new URL(authLccnLocalFileUrlString)).openStream()); // if(xmlDocCheck) { authLccnPrefixXmlDoc = (org.w3c.dom.Document)doc; } // javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance(); javax.xml.xpath.XPath xpath = factory.newXPath(); xpath.setNamespaceContext(this); javax.xml.xpath.XPathExpression expr = xpath.compile("//*[local-name()='row']"); Object result = expr.evaluate(doc, javax.xml.xpath.XPathConstants.NODESET); // org.w3c.dom.NodeList nl = null; org.w3c.dom.Node nd = null; org.w3c.dom.NamedNodeMap nnm = null; org.w3c.dom.Attr atr = null; if(result!=null) { nl = (org.w3c.dom.NodeList)result; logger.debug("nl length: " + nl.getLength() + ":::"); for(int i = 0; i < nl.getLength(); i++) { nd = nl.item(i); nnm = nd.getAttributes(); atr = (org.w3c.dom.Attr)nnm.item(0); authLccnPrefixList.add(atr.getValue()); }//end for }//end if }