根据xml所在的包名，扫描得到其下所有的URL.
@param xmlPackage xml包
@return url集合
499167
private List<URL> getDirUrls(String xmlPackage) {
        try {
            return Collections.list(Thread.currentThread().getContextClassLoader().getResources(xmlPackage));
        } catch (IOException e) {
            log.error("无法解析配置的zealot xml路径下文件的URL，将被忽略.该路径为:" + xmlPackage + "，请检查!", e);
            return Collections.emptyList();
        }
    }
493662
public static String repositoryUrl( HttpServletRequest request ) {
        String requestURL = request.getRequestURL().toString();
        int delimiterSegmentIdx = requestURL.length();
        for (String methodName : ALL_METHODS) {
            if (requestURL.indexOf(methodName) != -1) {
                delimiterSegmentIdx = requestURL.indexOf(methodName);
                break;
            }
        }
        return requestURL.substring(0, delimiterSegmentIdx);
    }
1329998
private void generatePackageXml(File packageFile, Collection<ArchiveEntry> files) throws Exception
    {
        getLog().info(String.format("Generating package.xml descriptor at [%s]", packageFile.getPath()));

        OutputFormat outputFormat = new OutputFormat("", true);
        outputFormat.setEncoding(this.encoding);
        OutputStream out = new FileOutputStream(packageFile);
        XMLWriter writer = new XMLWriter(out, outputFormat);
        writer.write(toXML(files));
        writer.close();
        out.close();
    }
1191684
public Node getDOM()
    {
        Object root = m_message.getRawData();
        try {
            String strSOAPPackage = (String)((TrxMessageHeader)this.getMessage().getMessageHeader()).get(SOAPMessageTransport.SOAP_PACKAGE);

            Node node = null;            
            DocumentBuilder db = Util.getDocumentBuilder();
            Document doc = db.newDocument();            
            
            Marshaller m = JaxbContexts.getJAXBContexts().getMarshaller(strSOAPPackage);
            if (m == null)
                return null;
            synchronized(m)
            {   // Since the marshaller is shared (may want to tweek this for multi-cpu implementations)
                m.marshal( root, doc );
            }
            node = doc.getDocumentElement();

            if (node != null)
                return node;
        } catch (JAXBException ex)   {
            ex.printStackTrace();
        } catch (java.lang.IllegalArgumentException ex)   {
            ex.printStackTrace();
        }
        return super.getDOM();
    }
587967
def _getSyntaxByXmlFileName(self, xmlFileName):
        
        import qutepart.syntax.loader  # delayed import for avoid cross-imports problem

        with self._loadedSyntaxesLock:
            if not xmlFileName in self._loadedSyntaxes:
                xmlFilePath = os.path.join(os.path.dirname(__file__), "data", "xml", xmlFileName)
                syntax = Syntax(self)
                self._loadedSyntaxes[xmlFileName] = syntax
                qutepart.syntax.loader.loadSyntax(syntax, xmlFilePath)

            return self._loadedSyntaxes[xmlFileName]
316815
public XmlHttpResponse doHttpGetXml(String url) {
        XmlHttpResponse response = new XmlHttpResponse();
        doGet(url, response);
        setContext(response);
        return response;
    }
624105
public static String getPackageName(Elements elementUtils, Element element) {
		return elementUtils.getPackageOf(element).getQualifiedName().toString();
	}
1157859
protected String extractPackageName(final Class<?> root) {
        return root.getName().substring(0, root.getName().length() - root.getSimpleName().length() - 1);
    }
579298
public T loadXml(String locationUrl) {

    DataResource resource = this.resourceFactory.createDataResource(locationUrl);
    return loadXml(resource);
  }
64699
@Requires("pathName != null")
  @Ensures("result != null")
  public static String getPackageName(String pathName) {
    int lastSep = pathName.lastIndexOf('.');
    if (lastSep == -1) {
      return "";
    } else {
      return pathName.substring(0, lastSep);
    }
  }
357164
private void addClassByPackage(ClassLoader classLoader, String packageName) {
        // 根据包名和Classloader实例，得到该包的URL Enumeration.
        String packageDirName = packageName.replace('.', '/');
        Enumeration<URL> urlEnum = this.getUrlsByPackge(classLoader, packageDirName);
        if (urlEnum == null) {
            return;
        }

        while (urlEnum.hasMoreElements()) {
            URL url = urlEnum.nextElement();
            String protocol = url.getProtocol();
            if ("file".equals(protocol)) {
                try {
                    this.addClassesByFile(classLoader, packageName, URLDecoder.decode(url.getFile(), "UTF-8"));
                } catch (UnsupportedEncodingException expected) {
                    // 此处不打印异常堆栈.
                    log.warn("该包结构无法转换成UTF-8的编码格式.");
                }
            } else if ("jar".equals(protocol)) {
                this.addClassByJar(classLoader, url, packageName, packageDirName);
            }
        }
    }
891201
public Document stringToDom(String xmlSource) throws S2SException {
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            DocumentBuilder builder = factory.newDocumentBuilder();
            return builder.parse(new InputSource(new StringReader(xmlSource)));
        }
        catch (SAXException | IOException | ParserConfigurationException ex) {
            throw new S2SException(ex.getMessage(), ex);
        }
    }
478821
def package_url(self):
        """"""

        if self.resource_file == DEFAULT_METATAB_FILE or self.target_format in ('txt','ipynb'):
            u = self.inner.clone().clear_fragment()
            u.path = dirname(self.path) + '/'
            u.scheme_extension = 'metapack'
        else:
            u = self

        return MetapackPackageUrl(str(u.clear_fragment()), downloader=self._downloader)
507000
public static DocPath forPackage(PackageElement pkgElement) {
        return pkgElement == null || pkgElement.isUnnamed()
                ? empty
                : DocPath.create(pkgElement.getQualifiedName().toString().replace('.', '/'));
    }
838225
public static String getManifestXml(byte[] apkData, Locale locale) throws IOException {
        try (ByteArrayApkFile apkFile = new ByteArrayApkFile(apkData)) {
            apkFile.setPreferredLocale(locale);
            return apkFile.getManifestXml();
        }
    }
1197338
@Nullable
  public JAXBContext getFromCache (@Nonnull final Package aPackage)
  {
    return getFromCache (aPackage, (ClassLoader) null);
  }
1132330
protected Content getPackage(PackageElement pkg, ModuleElement mdle) {
        Content packageLinkContent;
        Content pkgLabel;
        if (!pkg.isUnnamed()) {
            pkgLabel = getPackageLabel(utils.getPackageName(pkg));
            packageLinkContent = getHyperLink(pathString(pkg,
                     DocPaths.PACKAGE_FRAME), pkgLabel, "",
                    "packageFrame");
        } else {
            pkgLabel = new StringContent("<unnamed package>");
            packageLinkContent = getHyperLink(DocPaths.PACKAGE_FRAME,
                    pkgLabel, "", "packageFrame");
        }
        Content li = HtmlTree.LI(packageLinkContent);
        return li;
    }