Package com.jclark.xsl.om

Examples of com.jclark.xsl.om.Node


        lastModified = xslFile.lastModified();

        // XT internal
        engine = new EngineImpl(sheetLoader, new ExtensionHandlerImpl());
        try {
            Node node = sheetLoader.load(sheetSource,
                       0,
                       engine.getSheetLoadContext(),
                       engine.getNameTable());
            sheet = engine.createSheet(node);
        } catch (XSLException e) {
View Full Code Here


    void handleXSLException(XSLException e) throws SAXException, IOException {
        log.error("XTTransformer", e);
        String systemId = null;
        int lineNumber = -1;
        Node node = e.getNode();
        if (node != null) {
            URL url = node.getURL();
            if (url != null)
                systemId = url.toString();
            lineNumber = node.getLineNumber();
        }
        Exception wrapped = e.getException();
        String message = e.getMessage();
        if (systemId != null || lineNumber != -1)
            throw new SAXParseException(message,
View Full Code Here

        lastModified = xslFile.lastModified();

        // XT internal
        engine = new EngineImpl(sheetLoader, new ExtensionHandlerImpl());
        try {
            Node node = sheetLoader.load(sheetSource,
                       0,
                       engine.getSheetLoadContext(),
                       engine.getNameTable());
            sheet = engine.createSheet(node);
        } catch (XSLException e) {
View Full Code Here

    void handleXSLException(XSLException e) throws SAXException, IOException {
        log.error("XTTransformer", e);
        String systemId = null;
        int lineNumber = -1;
        Node node = e.getNode();
        if (node != null) {
            URL url = node.getURL();
            if (url != null)
                systemId = url.toString();
            lineNumber = node.getLineNumber();
        }
        Exception wrapped = e.getException();
        String message = e.getMessage();
        if (systemId != null || lineNumber != -1)
            throw new SAXParseException(message,
View Full Code Here

        lastModified = xslFile.lastModified();

        // XT internal
        engine = new EngineImpl(sheetLoader, new ExtensionHandlerImpl());
        try {
            Node node = sheetLoader.load(sheetSource,
                       0,
                       engine.getSheetLoadContext(),
                       engine.getNameTable());
            sheet = engine.createSheet(node);
        } catch (XSLException e) {
View Full Code Here

    void handleXSLException(XSLException e) throws SAXException, IOException {
        log.error("XTTransformer", e);
        String systemId = null;
        int lineNumber = -1;
        Node node = e.getNode();
        if (node != null) {
            URL url = node.getURL();
            if (url != null)
                systemId = url.toString();
            lineNumber = node.getLineNumber();
        }
        Exception wrapped = e.getException();
        String message = e.getMessage();
        if (systemId != null || lineNumber != -1)
            throw new SAXParseException(message,
View Full Code Here

        Node startHighlight,
        Node endHighlight) {
    Enumeration keys = _arrays.keys();
    while (keys.hasMoreElements()) {
      Vector children = new Vector();
      Node textNode = (Node)keys.nextElement();
      IntegerArray numbers = (IntegerArray)_arrays.get(textNode);
      numbers.sort();    // word numbers in ascending order
      String text = textNode.getData();
      tokenizer.setText(text);
      int tokenNumber = 0;
      int lastOffset = 0;
      for (int i = 0; i < numbers.cardinality(); i++) {
  int n = numbers.at(i);
  Token token;
  do {
    token = tokenizer.nextToken();
  }
  while (++tokenNumber < n);
  int start = token.getStart();
  int end   = token.getEnd();
  if (lastOffset < start)
    children
      .addElement(factory.makeTextNode(text.substring(lastOffset, start)));
  children.addElement(startHighlight);
  children.addElement(factory.makeTextNode(token.getData()));
  children.addElement(endHighlight);
  lastOffset = end;
      }
      if (lastOffset < text.length())
  children.addElement(factory.makeTextNode(text.substring(lastOffset)));
      Node2[] childrenArray = new Node2[children.size()];
      children.toArray(childrenArray);
      Node highlighted = factory.makeSubstituteElement(highlightedName,
                   childrenArray,
                   textNode);
      Node2 parent = (Node2)textNode.getParent();
      for (int i = 0; i < childrenArray.length; i++)
  ((Node2)childrenArray[i]).setParent(highlighted);
View Full Code Here

    public Node2 getRepresentation() {
  return _node;
    }

    public TreeNode getParent() {
  Node parent = _node.getParent();
  return parent != null ? makeNode(parent) : null;
    }
View Full Code Here

        Node startHighlight,
        Node endHighlight) {
    Enumeration keys = _arrays.keys();
    while (keys.hasMoreElements()) {
      Vector children = new Vector();
      Node textNode = (Node)keys.nextElement();
      IntegerArray numbers = (IntegerArray)_arrays.get(textNode);
      numbers.sort();    // word numbers in ascending order
      String text = textNode.getData();
      tokenizer.setText(text);
      int tokenNumber = 0;
      int lastOffset = 0;
      for (int i = 0; i < numbers.cardinality(); i++) {
  int n = numbers.at(i);
  Token token;
  do {
    token = tokenizer.nextToken();
  }
  while (++tokenNumber < n);
  int start = token.getStart();
  int end   = token.getEnd();
  if (lastOffset < start)
    children
      .addElement(factory.makeTextNode(text.substring(lastOffset, start)));
  children.addElement(startHighlight);
  children.addElement(factory.makeTextNode(token.getData()));
  children.addElement(endHighlight);
  lastOffset = end;
      }
      if (lastOffset < text.length())
  children.addElement(factory.makeTextNode(text.substring(lastOffset)));
      Node2[] childrenArray = new Node2[children.size()];
      children.toArray(childrenArray);
      Node highlighted = factory.makeSubstituteElement(highlightedName,
                   childrenArray,
                   textNode);
      Node2 parent = (Node2)textNode.getParent();
      for (int i = 0; i < childrenArray.length; i++)
  ((Node2)childrenArray[i]).setParent(highlighted);
View Full Code Here

    public Node2 getRepresentation() {
  return _node;
    }

    public TreeNode getParent() {
  Node parent = _node.getParent();
  return parent != null ? makeNode(parent) : null;
    }
View Full Code Here

TOP

Related Classes of com.jclark.xsl.om.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.