Package javax.xml.stream.events

Examples of javax.xml.stream.events.ProcessingInstruction


  public org.dom4j.ProcessingInstruction readProcessingInstruction(
      XMLEventReader reader) throws XMLStreamException {
    XMLEvent event = reader.peek();

    if (event.isProcessingInstruction()) {
      ProcessingInstruction pi = (ProcessingInstruction) reader
          .nextEvent();

      return createProcessingInstruction(pi);
    } else {
      throw new XMLStreamException("Expected PI event, found: " + event);
View Full Code Here


    return null;
  }

  public String getPIData() {
    if (current.isProcessingInstruction()) {
      ProcessingInstruction pi = (ProcessingInstruction) current;
      return pi.getData();
    } else {
      throw new IllegalStateException(current.toString());
    }
  }
View Full Code Here

    }
  }

  public String getPITarget() {
    if (current.isProcessingInstruction()) {
      ProcessingInstruction pi = (ProcessingInstruction) current;
      return pi.getTarget();
    } else {
      throw new IllegalStateException(current.toString());
    }
  }
View Full Code Here

                    fSchemaDOMParser.startCDATA(null);
                    sendCharactersToSchemaParser(currentEvent.asCharacters().getData(), false);
                    fSchemaDOMParser.endCDATA(null);
                    break;
                case XMLStreamConstants.PROCESSING_INSTRUCTION:
                    ProcessingInstruction pi = (ProcessingInstruction)currentEvent;
                    fillProcessingInstruction(pi.getData());
                    fSchemaDOMParser.processingInstruction(pi.getTarget(), fTempString, null);
                    break;
                case XMLStreamConstants.DTD:
                    /* There shouldn't be a DTD in the schema */
                    break;
                case XMLStreamConstants.ENTITY_REFERENCE:
View Full Code Here

                    fSchemaDOMParser.startCDATA(null);
                    sendCharactersToSchemaParser(currentEvent.asCharacters().getData(), false);
                    fSchemaDOMParser.endCDATA(null);
                    break;
                case XMLStreamConstants.PROCESSING_INSTRUCTION:
                    ProcessingInstruction pi = (ProcessingInstruction)currentEvent;
                    fillProcessingInstruction(pi.getData());
                    fSchemaDOMParser.processingInstruction(pi.getTarget(), fTempString, null);
                    break;
                case XMLStreamConstants.DTD:
                    /* There shouldn't be a DTD in the schema */
                    break;
                case XMLStreamConstants.ENTITY_REFERENCE:
View Full Code Here

        break;
      case XMLEvent.END_ELEMENT:
        this.streamWriter.writeEndElement();
        break;
      case XMLEvent.PROCESSING_INSTRUCTION:
        final ProcessingInstruction instruction = (ProcessingInstruction) _event;
        this.streamWriter.writeProcessingInstruction( instruction.getTarget(), instruction.getData() );
        break;
      case XMLEvent.CHARACTERS:
        Characters characters = _event.asCharacters();
        if (characters.isCData()) {
          this.streamWriter.writeCData( characters.getData() );
View Full Code Here

            }
            case XMLEvent.NOTATION_DECLARATION: {
                break;
            }
            case XMLEvent.PROCESSING_INSTRUCTION: {
                ProcessingInstruction pi = (ProcessingInstruction)xmlEvent;
                contentHandler.processingInstruction(pi.getTarget(), pi.getData());
                break;
            }
            case XMLEvent.SPACE: {
                char[] characters = xmlEvent.asCharacters().getData().toCharArray();
                contentHandler.characters(characters, 0, characters.length);
View Full Code Here

    return null;
  }

  public String getPIData() {
    if (current.isProcessingInstruction()) {
      ProcessingInstruction pi = (ProcessingInstruction) current;
      return pi.getData();
    } else {
      throw new IllegalStateException(current.toString());
    }
  }
View Full Code Here

    }
  }

  public String getPITarget() {
    if (current.isProcessingInstruction()) {
      ProcessingInstruction pi = (ProcessingInstruction) current;
      return pi.getTarget();
    } else {
      throw new IllegalStateException(current.toString());
    }
  }
View Full Code Here

        if (!processed) {
          this.writer.writeEndElement();
        }
        break;
      case XMLEvent.PROCESSING_INSTRUCTION:
        final ProcessingInstruction instruction = (ProcessingInstruction) e;
        this.writer.writeProcessingInstruction( instruction.getTarget(), instruction.getData() );
        break;
      case XMLEvent.CHARACTERS:
        writeCharacters( e.asCharacters() );
        break;
      case XMLEvent.COMMENT:
View Full Code Here

TOP

Related Classes of javax.xml.stream.events.ProcessingInstruction

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.