protected String getStyleSheet(final Document doc) { String styleSheet = null; for (final Content c : doc.getContent(new ContentFilter(ContentFilter.PI))) { final ProcessingInstruction pi = (ProcessingInstruction) c; if ("text/xsl".equals(pi.getPseudoAttributeValue("type"))) { styleSheet = pi.getPseudoAttributeValue("href"); break; } } return styleSheet; } }
protected String getStyleSheet(final Document doc) { String styleSheet = null; for (final Content c : doc.getContent(new ContentFilter(ContentFilter.PI))) { final ProcessingInstruction pi = (ProcessingInstruction) c; if ("text/xsl".equals(pi.getPseudoAttributeValue("type"))) { styleSheet = pi.getPseudoAttributeValue("href"); break; } } return styleSheet; } }
private void normaliseLineEndings( Document document ) { for ( Iterator<?> i = document.getDescendants( new ContentFilter( ContentFilter.COMMENT ) ); i.hasNext(); ) { Comment c = (Comment) i.next(); c.setText( ReleaseUtil.normalizeLineEndings( c.getText(), ls ) ); } for ( Iterator<?> i = document.getDescendants( new ContentFilter( ContentFilter.CDATA ) ); i.hasNext(); ) { CDATA c = (CDATA) i.next(); c.setText( ReleaseUtil.normalizeLineEndings( c.getText(), ls ) ); } }