Error in Parser.fx file "incompatible types found   : java.util.Properties"

Hi,
In parser file "Parser.fx",
public-read def PROPERTIES_PARSER = StreamParser {
override public function parse(input : java.io.InputStream) : RecordSet {
var props = javafx.util.Properties {};
props.load(input);
input.close();
MemoryRecordSet {
records: [
MapRecord {
fields: props
due to under line portion an error is appearing:
"incompatible types
found : javafx.util.Properties
required: java.util.Map
fields: props".
Please suggest some solution.
Thanks in advance.
regards,
Choudhary Nafees Ahmed
Edited by: ChoudharyNafees on Jul 5, 2010 3:48 AM

Parser.fx
package org.netbeans.javafx.datasrc;
import javafx.data.pull.PullParser;
import javafx.data.pull.Event;
import org.netbeans.javafx.datasrc.MemoryRecordSet;
public-read def PROPERTIES_PARSER = StreamParser {
    override public function parse(input : java.io.InputStream) : RecordSet {
        var props =java.util.Properties{};
        props.load(input);
        input.close();
        MemoryRecordSet {
            records: [
                MapRecord {
                    fields: props
public-read def LINE_PARSER_FIELD_LINE = ".line";
public-read def LINE_PARSER = StreamParser {
    override public function parse(input : java.io.Reader) : RecordSet {
        var line : String;
        var result : Record [] = [];
        line = readLine(input);
        // BEWARE  ("" == null) is true
        while (line != null or "".equals(line)) {
            var map = new java.util.HashMap();
            map.put(LINE_PARSER_FIELD_LINE, line);
            var record = MapRecord {
                fields: map
            insert record into result;
            line = readLine(input);
        MemoryRecordSet {
            records: result
function readLine(in : java.io.Reader) : String {
    var str = new java.lang.StringBuilder;
    while (true) {
        var c = in.read();
        if (c == -1) {
            return if (str.length() == 0) then null else str.toString();
        } else if (c == 0x0D) {
            c = in.read();
            if (c == 0x0A or c == -1) {
                return str.toString();
            str.append(0x0D);
        } else if (c == 0x0A) {
            return str.toString();
        str.append(c as Character);
    str.toString()
public-read def JSON_PARSER = StreamParser {
    function toSequence(list : java.util.List) : Record [] {
        var result : Record [] = [];
        var ii = list.iterator();
        while (ii.hasNext()) {
            var r = ii.next() as Record;
            insert r into result;
        result
    override public function parse(input : java.io.InputStream) : RecordSet {
        var topLevel : Object;
        def parser = PullParser {
            documentType: PullParser.JSON
            input: input
            var mapStack = new java.util.Stack();
            var currentMap : java.util.Map;
            var recordsStack = new java.util.Stack();
            var currentRecords : java.util.List;
            var lastEvent: Event;
            onEvent: function(event: Event) {
                if (event.type == PullParser.TEXT) {
                    currentMap.put(event.name, event.text)
                } else if (event.type == PullParser.INTEGER) {
                    currentMap.put(event.name, event.integerValue)
                } else if (event.type == PullParser.NULL) {
                    currentMap.put(event.name, null)
                } else if (event.type == PullParser.START_ELEMENT) {
                    if (lastEvent.type == PullParser.START_ARRAY_ELEMENT) return;
                    var oldMap = currentMap;
                    var temp = new java.util.HashMap();
                    temp.put(new Object(), null);
                    currentMap = temp;
                    currentMap.clear();
                    mapStack.push(currentMap);
                    if (topLevel == null) topLevel = currentMap;
                    if (oldMap != null) {
                        var mr = MapRecord {
                            fields: currentMap
                        if (event.name == "" and lastEvent.type == PullParser.START_VALUE) {
                            oldMap.put(lastEvent.name, mr)
                        } else {
                            oldMap.put(event.name, mr)
                } else if (event.type == PullParser.START_ARRAY_ELEMENT) {
                    var temp = new java.util.HashMap();
                    temp.put(new Object(), null);
                    currentMap = temp;
                    currentMap.clear();
                    mapStack.push(currentMap);
                    var mr = MapRecord {
                        fields: currentMap
                    currentRecords.add(mr);
                } else if (event.type == PullParser.END_ELEMENT) {
                    mapStack.pop();
                    if (not mapStack.empty()) {
                        currentMap = mapStack.peek() as java.util.HashMap;
                    } else {
                        currentMap = null;
                } else if (event.type == PullParser.END_ARRAY_ELEMENT) {
                    if (lastEvent.type == PullParser.END_ELEMENT) return;
                    mapStack.pop();
                    if (not mapStack.empty()) {
                        currentMap = mapStack.peek() as java.util.HashMap;
                    } else {
                        currentMap = null;
                } else if (event.type == PullParser.START_ARRAY) {
                    currentRecords = new java.util.ArrayList();
                    recordsStack.push(currentRecords);
                    if (topLevel == null) topLevel = currentRecords;
                } else if (event.type == PullParser.END_ARRAY) {
                    var set = MemoryRecordSet {
                        records: toSequence(currentRecords)
                    currentMap.put(event.name, set);
                    recordsStack.pop();
                    if (not recordsStack.empty()) {
                        currentRecords = recordsStack.peek() as java.util.List;
                    } else {
                        currentRecords = null;
                lastEvent = event;
        parser.parse();
        if (topLevel instanceof java.util.Map) {
            var mr = MapRecord {
                fields: topLevel as java.util.Map
            MemoryRecordSet {
               records: [mr]
        } else {
            // List
            var rs = MemoryRecordSet {
                records: toSequence(topLevel as java.util.List)
            rs
        parser.parse();
        var mr = MapRecord {
            fields: topLevel as java.util.Map
        MemoryRecordSet {
           records: [mr]

Similar Messages

  • Error(86,88): incompatible types; found: java.util.ArrayList

    Hi,
    I'm getting following error :
    Error(86,88): incompatible types; found: java.util.ArrayList, required: com.sun.java.util.collections.ArrayList
    The line JDev is complaining about contains the following code :
    com.sun.java.util.collections.ArrayList runtimeErrors = container.getExceptionsList();
    I really don't have a clue where this error comes from. If I right-click on ArrayList it brings me to the correct declaration.
    Does somebody know what I'm doing wrong?
    Thanks in advance for you help!
    Kris

    Kris,
    try changing the code to :
    java.util.ArrayList runtimeErrors = container.getExceptionsList();apparently container.getExceptionsList() returns a java.util.Arraylist not a com.sun.java.util.collections.ArrayList
    HTH,
    John

  • Incompatible types - found java.lang.String but expected int

    This is an extremely small simple program but i keep getting an "incompatible types - found java.lang.String but expected int" error and dont understand why. Im still pretty new to Java so it might just be something stupid im over looking...
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class Lab
    public static void main(String []args)
    int input = JOptionPane.showInputDialog("Input Decimal ");
    String bin = Integer.toBinaryString(input);
    String hex = Integer.toHexString(input);
    System.out.println("Decimal= " + input + '\n' + "Binary= " + bin + '\n' + "Hexadecimal " + hex);
    }

    You should always post the full, exact error message.
    Your error message probably says that the error occurred on something like line #10, the JOptionPane line. The error is telling you that the compiler found a String value, but an int value was expected.
    If you go to the API docs for JOptionPane, it will tell you what value type is returned for showInputDialog(). The value type is String. But you are trying to assign that value to an int. You can't do that.
    You will need to assign the showInputDialog() value to a String variable. Then use Integer.parseInt(the_string) to convert to an int value.

  • Incompatible type found

    Gurus,
    I'm getting the following error and hope you could help. It's complaining about code in my AM (in bold). Any ideas?
    Error(281,41): incompatible types; found: oracle.jbo.Row, required: acctmap.oracle.apps.spl.am.server.UserRespVORowImpl
    AM code:
    UserRespVOImpl reqVO = (UserRespVOImpl)findViewObject("Sysadmin");
    if(reqVO!=null)
    Integer userid = new Integer(tx.getUserId());
    reqVO.initUserRespVO(userid);
    reqVO.reset();
    UserRespVORowImpl row = reqVO.next();
    String priv = (String)row.getSysadmin();
    VO code:
    public void initUserRespVO(Integer txUserId)
    setWhereClauseParams(null); //Always reset
    setWhereClauseParam(0,txUserId);
    executeQuery();
    // return Sysadmin;
    }

    Hi Sreese,
    Change your code to ...
    reqVO.reset();
    UserRespVORowImpl row = *(UserRespVORowImpl)* reqVO.next();
    String priv = (String)row.getSysadmin();
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                   

  • HT1848 I cannot authorize my computer, I'm having this error message The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed." please hel

    cannot authorize my computer, I'm having this error message The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed." please help me

    Doublechecking. In the course of your troubleshooting to date, have you worked through the instructions from the following document?
    iTunes: Missing folder or incorrect permissions may prevent authorization

  • HT2932 When I try to save a file from my GarageBand to my PC it keeps giving me a error message . Message says could not be copied because error occurred. The file cannot be found. Any suggestions?

    When I try to save a file from my GarageBand to my PC it keeps giving me a error message . Message says could not be copied because error occurred. The file cannot be found. Any suggestions?

    I was trying to upload from my iPad to my pc.
    That was hard for us to guess, from your post It might have helped to mention the iPad.
    How are you trying to save the song to your PC? Are you sending the song to iTunes? If yes, as a project or as an audio file? Make sure, you select "AAC" and not "GarageBand", when you share the song from your iPad.
    If the clip is not too large, you might alternately try to share it by mail, see:
    Share GarageBand songs

  • Incompatible types - found, required...

    Experts,
    I am getting the following failure. What am I missing?
    Javac output,
    #javac .\org\ocap\dvr\*.java
    .\org\ocap\dvr\TestRecord.java:123: incompatible types
    found : org.ocap.shared.dvr.RecordingManager
    required: org.ocap.dvr.OcapRecordingManager
    recManager = OcapRecordingManager.getInstance();
    ^
    The source code is as follows,
    In .\src\org\ocap\shared\dvr\RecordingManager.java
    ----------------- START --------------------
    package org.ocap.shared.dvr;
    public abstract class RecordingManager
    public static RecordingManager getInstance()
    return null;
    // stuff deleted
    ------------------ END -------------------
    In .\src\org\ocap\dvr\OcapRecordingManager.java
    ----------------- START --------------------
    package org.ocap.dvr;
    import org.ocap.dvr.*;
    import org.ocap.shared.dvr.*;
    public abstract class OcapRecordingManager extends RecordingManager
    // stuff deleted
    ------------------ END -------------------
    In .\src\org\ocap\dvr\OcapRecordingManagerImpl.java
    ----------------- START --------------------
    package org.ocap.dvr;
    import org.ocap.dvr.*;
    import org.ocap.shared.dvr.*;
    public class OcapRecordingManagerImpl extends OcapRecordingManager
    private static OcapRecordingManager mOcapRecordingManager = null;
    public static OcapRecordingManager getInstance()
    if (mOcapRecordingManager == null)
    mOcapRecordingManager = new OcapRecordingManagerImpl();
    return mOcapRecordingManager;
    ------------------ END -------------------
    In .\src\org\ocap\dvr\TestRecord.java
    ----------------- START --------------------
    package org.ocap.dvr;
    import org.ocap.dvr.OcapRecordingManager;
    import org.ocap.shared.dvr.RecordingManager;
    class TestRecord
    //Object of OcapRecordingManager class
    private static OcapRecordingManager recManager = null;
    public static void main(String args[])
    recManager = OcapRecordingManager.getInstance();
    if(recManager == null)
    System.out.println ("Value obtained in OcapRecordingManagerImpl reference is null");
    ------------------ END -------------------
    Thanks!

    Please don't crosspost!
    http://forum.java.sun.com/thread.jspa?threadID=5210277&messageID=9846716#9846716

  • I GET AN ERROR MESSAGE SAYING, THIS FILE CANNOT BE FOUND

    WHEN I TRY TO OPEN A FILE.
    I GET AN ERROR MESSAGE SAYING, THIS FILE CANNOT BE FOUND.
    WHAT CAN I DO?

    We really don't know what problem you are having; you don't provide any details that we can understand.
    First you write "WHEN I TRY TO OPEN A FILE..." - what kind of file?  From where - from your local disk, or a website?
    Then you write "How do I open and read my message?" - what kind of message?
    Also tell us your operating system, browser, email client, Reader version, ... anything that is related to your problem.

  • Unable to validate a java.util.Properties XML based File

    I cannot for the life of me figure out what is wrong with this xml file, but it fails the validation of java.util.Properties and as such won't be parsed in. Help!
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
    <properties version="1.0">
      <entry key="bottleneckServer.address"></entry>
      <entry key="bottleneckServer.port">8206</entry>
      <entry key="bottleneckServer.confirmDelay">10</entry>
      <entry key="bottleneckServer.cleanupDelay">120</entry>
    </properties>Thanks in advance!

    This xml file works perfectly.
    Here is some test code:
            Properties p = new Properties();
            p.loadFromXML(getClass().getClassLoader().getResourceAsStream("someFilePath/someFileName.xml"));
            assert "8206".equals(p.getProperty("bottleneckServer.port")) : "Property 'bottleneckServer.port' != 8206";

  • I keep getting this error message The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed.

    I keep getting this messae when I try to share itune to my new mac The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed.

    Doublechecking. In the course of your troubleshooting to date, have you worked through the instructions from the following document?
    iTunes: Missing folder or incorrect permissions may prevent authorization

  • Error installing iTunes 11 file cannot be found in cabinet file

    I am updating my iTunes as I need it in order to plug iPhone in and manage it.
    This message keeps coming up everytime I try and download it:
    ''The file 'DlFxAPl.dll.34BE82C4_E596_4E99_A191_52C6199EBF69' cannot be installed because the file cannot be found in cabinet file 'GEARDrivers_x64.cab'. This could indicate a network error, an error reading from the CD-Rom, or a problem with this package.''
    I am relatively computer literate and I have tried everything to try to overcome this. It's so frustrating.
    Would really appreciate someone letting me know what I can do?

    Hello,
    Is you library located on the internal drive? My first suggestion would be to repair permissions using disk utility.
    Mac OS error -54 (permErr): permissions error (on file open)

  • Error while deploying a web service whose return type is java.util.Date

    Hi
    I have written a simple web service which takes in a date input (java.util.Date) and returns the same date back to the client.
    public interface Ping extends Remote
    * A simple method that pings the server to test the webservice.
    * It sends a datetime to the server which returns the datetime.
    * @param pingDateRequest A datetime sent to the server
    * @returns The original datetime
    public Date ping(Date pingDateRequest) throws RemoteException;
    The generation of the Web service related files goes smoothly in JDeveloper 10g. The problem arises when I try to deploy this web service on the Oracle 10g (10.0.3) OC4J standalone. it gives me the following error on the OC4J console :
    E:\Oracle\oc4j1003\j2ee\home\application-deployments\Sachin-TradingEngineWS-WS\
    WebServices\com\sachin\tradeengine\ws\Ping_Tie.java:57: ping(java.util.Date) in com.sachin.tradeengine.ws.Ping cannot be applied to (java.util.Calendar) _result  = ((com.sachin.tradeengine.ws.Ping) getTarget()).ping
    (myPing_Type.getDate_1());
    ^
    1 error
    04/03/23 17:17:35 Notification ==&gt; Application Deployer for Sachin-TradingEngineWS-WS FAILED: java.lang.InstantiationException: Error compiling :E:\Oracle\oc4j1003\j2ee\home\applications\Sachin-TradingEngineWS-WS\WebServices: Syntax error in source [ 2004-03-23T17:17:35.937GMT+05:30 ]
    I read somewhere that the conversion between java to xml datatype and vice versa fails for java.util.Date, so it is better to use java.util.Calendar. When I change the code to return a java.util.Calendar then the JDeveloper prompts me the following failure:
    Method Ping: the following parameter types do not have an XML Schema mapping and/or serializer specified : java.util.Calendar.
    This forces me to return a String data.
    I would appreciate if someone can help me out.
    Thanks
    Sachin Mathias
    Datamatics Ltd.

    Hi
    I got the web service working with some work around. But I am not sure it this approach would be right and good.
    I started altogether afresh. I did the following step :
    1. Created an Interface (Ping.java) for use in web Service as follows :
    public interface Ping extends Remote{
    public java.util.Date ping(java.util.Date pingDateRequest)
    throws RemoteException;
    2. Implemented the above interface in PingImpl.java as follows :
    public class PingImpl implements Ping
    public java.util.Date ping(java.util.Date pingDateRequest) throws RemoteException {
    System.out.println("PingImpl: ping() return datetime = " + pingDateRequest.toString());
    return pingDateRequest;
    3. Compiled the above 2 java files.
    4. Generated a Stateless Java Web Service with the help of JDeveloper. This time the generation was sucessful.(If I had "java.util.Calendar" in place of "java.util.Date" in the java code of the above mentioned files the web service generation would prompt me for error)
    5. After the generation of Web Service, I made modification to the Ping interface and its implementing class. In both the files I replaced "java.util.Date" with "java.util.Calendar". The modified java will look as follows :
    Ping.Java
    =========
    public interface Ping extends Remote{
    public java.util.Calendar ping(java.util.Calendar pingDateRequest)
    throws RemoteException;
    PingImpl.Java
    ================
    public class PingImpl implements Ping
    public java.util.Calendar ping(java.util.Calendar pingDateRequest) throws RemoteException {
    System.out.println("PingImpl: ping() return datetime = " + pingDateRequest.toString());
    return pingDateRequest;
    6. Now I recompile both the java files.
    7. Withour regenerating the Web Service I deploy the Web Service on OC4j 10.0.3 from JDeveloper. This time the deployment was sucessful.(The Deployment fails if I don't follow the step 5.)
    8. Now I generated a Stub from JDeveloper and accessed the stub from a client. It works fine. Here if you see the Stub code it takes java.util.Date as a parameter and returns a java.util.Date. (Mind you I am accepting a java.util.Calendar and returning the same in my Web Service interface. Step 5)
    The confusing thing is the Serialization and Deserialization of Data from Client java data to Soap message and Soap message to Server java data.
    From Client to SOAP :
    java.util.Date to datetime
    From SOAP to Server :
    datetime to java.util.Calendar
    From Server to SOAP :
    java.util.Calendar to datetime
    From SOAP to Client :
    datetime to java.util.Date (I am not able to understand this part of the conversion)
    Any help or inputs would be appreciated.
    Thanks
    Sachin Mathias

  • Parsing Error while Parsing XML file

    Hi I am trying to parse an xml file with use of an stylehseet as shown below but its giving an error message as follows
    [Fatal Error] myfile2.xml:1:8: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:235)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
    at Stylizer.main(Stylizer.java:50)
    The sample xml file is
    - <nitf id="366045">
    - <head>
    <title type="main">������� �������� ������</title>
    - <tobject toobject.type="���� �����">
    <tobject.subject tobject.subject.type="�����" tobject.subject.matter="����� ������" />
    </tobject>
    - <docdata>
    <date.issue norm="28/09/2002" />
    <doc.copyright year="YYYY" holder="Aljazeera.net" />
    </docdata>
    <pubdata type="web" position.section="�����" />
    </head>
    - <body>
    - <body.head>
    - <hedline>
    <hl1>������� �������� ������</hl1>
    </hedline>
    - <byline>
    <person>�������</person>
    </byline>
    - <dateline>
    <location>�����</location>
    <story.date>31/03/1999</story.date>
    </dateline>
    <abstract>����� ����������� �������������� ���� ����� �������� ���� ��� ������� ������ �� ����� ������.</abstract>
    </body.head>
    <body.content>���� ������: �� ��� ��������. ���� ���� ��� ���� ���� �� ���� ����.</body.content>
    </body>
    </nitf>
    and stylesheet file is as follows:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="/">
    <xsl:for-each select="NITF_News/News/nitf">
    <xsl:value-of select='body.head/hedline/hl1'/>
    </xsl:for-each>     
    </xsl:template>
    </xsl:stylesheet>
    Now can anyone tell me why is this coming up
    Thanks
    Raj

    Sorry for that
    This is the xml file as follows : --
    <?xml version="1.0" encoding="UTF-16" ?>
    - <NITF_News xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://mycompany.com/mynamespace">
    - <user_data>
    <client_no>31</client_no>
    <profile_id>57</profile_id>
    <private_key>5A07A6F0-0535-46E8-87CF-398062BA77C3</private_key>
    </user_data>
    - <News>
    - <nitf id="365751">
    - <head>
    <title type="main">���� ���� ��� ����� �� ������� ���������</title>
    - <tobject toobject.type="������ ��������">
    <tobject.subject tobject.subject.type="�����" tobject.subject.matter="������ ������" />
    </tobject>
    - <docdata>
    <date.issue norm="29/09/2002" />
    <doc.copyright year="YYYY" holder="Aljazeera.net" />
    </docdata>
    <pubdata type="web" position.section="�����" />
    </head>
    - <body>
    - <body.head>
    - <hedline>
    <hl1>���� ���� ��� ����� �� ������� ���������</hl1>
    </hedline>
    - <byline>
    <person>none</person>
    </byline>
    - <dateline>
    <location>�������</location>
    <story.date>29/09/2002</story.date>
    </dateline>
    <abstract>���� ���� ���� ���������� ��� ����� �� ������� �������� �������� �� �������� ���� ��� ������� ������ ����� �� ������� �������� ���������. ��� ���� ������ ����� ��������� �� ���� ������ �� ����� ������ �� ������ ��� ������� ������.</abstract>
    </body.head>
    <body.content>������ ���� ���� ����� ��� ������ ��� ������� ������ ������ ����� ��������� ���� ���� ���� ���������� �� ����� ������ �������� ��� ����� �� ������� �������� �������� �� ������� ���� ��� ���� ������ ������� ��� ������ �� ����� ������ ���������. ���� ���� ��� �� ����� ���� ���� ���� ���� ������ "����� ����� ���� ����� ����� �� ������ ��������� �� ����� ��� ���� ���� ����"� ����� ��� �� ��� ������ ����� ��� ���� ������� ����� ��� ���� ������� ������ �� ���� ������. ����� ������ �� ����� ��� ����� ������ ������ ��������� ������� ����� ������ ������ ������ ��� �� �� ��� ��� �������� �������� ����� ������ �� ���� �������� �� ��� �������. ��� ���� ������ ����� ��������� �� ���� ������ �� ����� ������ ������� ������ �� ������ ����� ���� ��� ����� ����� ����� �� ���� ����� ������ �������. ���� �������� �������� �� ��� ����� ��� �������� ���� ����� �� ������� ������ ���� ���� ��� ���� ����� �� ��� ������ ����� ������� ��� ��� ��� ����� ���� ������ ��������. ���� ������ ������� ������ �� ������� �������� �� ������� ��� ��� ���� ����� �� ������ ��� ����� ������� ������� ������� ����� ��� ���� ������� ���������. ���� ��� �� ���� ���� ����� ����� ���� �� 800 ��� ��� ��� 1968 �� ������ ���� ���� ��� ����� ���� ������ ������ �� ���� ������� ����� ��� �����. ����� �������� ������� �������� �������� ��� ������ ��������� ����� �������.</body.content>
    </body>
    </nitf>
    </News>
    </NITF_News>
    I have a java program which will parse this xml file using an xsl file and will produce another xml file as desired by me .This new xml file format will be defined in the xsl file as follows
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="/">
    <?xml version="1.0" encoding="UTF-16"?>
    <businessnews>
    <xsl:for-each select="root/nitf">
    <story>
    <h1 color="RED">
    <headline>Headline<xsl:value-of select='mitem_maintitle'/></headline>
    <author>Author</author>
    <summary>Summary<xsl:value-of select='mitem_summary'/></summary>
    <article>Article</article>
    <date>Date<xsl:value-of select='published_date'/></date>
    <category>Category<xsl:value-of select='el_topics/main_topic_desc'/></category>
    </h1>
    </story>
    </xsl:for-each>
    </businessnews>
    </xsl:template>
    </xsl:stylesheet>
    Now it is always giving the error message as follows
    The processing instruction target matching "[xX][mM][lL]" is not allowed.
    Hoping for a positive reply
    Thanks
    Raj

  • "character conversion error" while parsing xml files

    Hello,
    I'm trying to parse MusicXML (Recordare) files, but I'm getting an exception.
    I'm using the SAX parser (javax.xml.parsers.SAXParser).
    Here is the code I use to instantiate it:
    final javax.xml.parsers.SAXParserFactory saxParserFactory = javax.xml.parsers.SAXParserFactory.newInstance();
    final javax.xml.parsers.SAXParser saxParser = saxParserFactory.newSAXParser();
    final org.xml.sax.XMLReader parser = saxParser.getXMLReader();
    I'm using my own handler, but I get the same exception even if I use org.xml.sax.helpers.DefaultHandler.
    The error I get is:
    Character conversion error: "Illegal ASCII character, 0xc2" (line number may be too low).
    The first few lines of my xml files look like this:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE score-partwise
    PUBLIC "-//Recordare//DTD MusicXML 0.6 Partwise//EN"
    "http://www.musicxml.org/dtds/partwise.dtd">
    <score-partwise>
    [...etc...]
    If I delete the <!DOCTYPE ...> line, then I don't get the exception anymore. But the MusicXML files I get (from some other program) always contain this line, and it would be quite some work to delete them from every file manually.
    So does anyone know if there is a way to avoid deleting that line in every file, while still being able to parse the xml files without exceptions?
    Or maybe does anyone know what the exact cause of the exception is? (because I don't know what exactly causes it)
    Thank you in advance.
    Greetz,
    Jipo

    So does anyone know if there is a way to avoid
    deleting that line in every file, while still being
    able to parse the xml files without exceptions?ok this is side-stepping the real problem but I've used this code to filterout DTD references for other reasons   public static InputStream filterOutDTDRef(InputStream in) throws IOException {
          BufferedReader iniReader = new BufferedReader(new InputStreamReader(in));
          StringBuffer newXML = new StringBuffer();
          for(String line = iniReader.readLine(); line!=null; line = iniReader.readLine())
             newXML.append(line+"\n");
          in.close();
          int s = newXML.indexOf("<!DOCTYPE ");
          if(s!=-1)
             newXML.replace(s,newXML.indexOf(">",s)+1,"");
          return new ByteArrayInputStream(newXML.toString().getBytes());
       }and it actually speeds up the parsing phase too (since the DTD ref.s were on the web and the XML standard mandates that there is a fetch for each xml file parsed..)
    you can feed the above into the InputSource constructor that takes an InputStream argument.
    Now for the real problem... 0xc2 is "LATIN CAPITAL LETTER A WITH CIRCUMFLEX" according to a unicode chart - which is not an ASCII character (as the error message correctly reports). I'm not sure why the file is being parsed as ASCII though? You could try parsing in a FileReader to the inputsource and hope it picks up the default character encoding of your system, and that that character encoding matches the file. Or you could try passing in a FileReader constructed with a explicit character encoding (eg "UTF8") and see if that does the trick?
    asjf

  • HT1933 My new computer has been authorized, but I can't play any of my purchased songs in itunes.  What do I do to play, I get an error message that original files cannot be found.

    My new HP ENVY 23 TOUCHSMART PC has been authorized for itunes, but I can't play any of my purchased itunes songs.  When I try to play a purchased song in my itunes library, I get an error message prompt stating that the song could not be used because the original file could not be found.  When I check for available downloads it states that all downloads have been made.  Ironically, all my movie purchases play fine, but the songs do not play.  What do I have to do to play my purchased songs? 

    The 'unable to locate' message means that you don't have those music files on that computer, or that they are not where iTunes is expecting them to be. How did you get the entries for those tracks in your new computer's iTunes ?
    If you still have your old computer then you can try copying them over again : http://support.apple.com/kb/HT4527
    You may also be able to re-download them from the store (checking for available downloads only checks for items that have not yet been downloaded, not for past purchases) via the Purchased link under Quick Links on the right-hand side of the iTunes store home page (re-downloading music isn't possible in all countries). You may need to delete them form your library first (where you are getting the 'unable to locate' message), otherwise iTunes will assume that you still have them somewhere and won't let you re-download them.
    Re-downloading : http://support.apple.com/kb/HT2519

Maybe you are looking for