facebook

XML code comletion using DTD [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #202985 Reply

    Can MyEclipse perform code completion for an XML document if the DTD is present ?
    If this is possible, can the DTD be read over te Internet.
    Or do I need a local copy of the DTD file ?

    #202988 Reply

    Riyad Kalla
    Member

    1) Yes code completion with a DTD
    2) Yes it can be located over the internet
    3) It will ALSO cache a local copy incase your internet connction goes down.

    So, you’re in luck! 🙂

    #203055 Reply

    That is what I read on a newsroup of Ecipse.
    However I cannot get it to work with fro example XML files of Jasper Reports.
    I click in a tag or in the middle of a paramter, then the ussual Ctrl+space, but nothing happens.
    Code example below:

    <?xml version=”1.0″?>
    <!DOCTYPE jasperReport PUBLIC “-//JasperReports//DTD Report Design//EN” “http://jasperreports.sourceforge.net/dtds/jasperreport.dtd”&gt;

    <jasperReport
    name=”ChartReport”
    pageWidth=”595″
    pageHeight=”842″
    columnWidth=”515″
    columnSpacing=”0″
    leftMargin=”40″
    rightMargin=”40″
    topMargin=”50″
    bottomMargin=”50″
    scriptletClass=”ChartScriptlet”>
    <variable name=”ChartImage” class=”java.awt.Image” calculation=”System”/>
    <title>
    <band height=”742″>
    <line>
    <reportElement x=”0″ y=”0″ width=”515″ height=”0″/>
    </line>
    <staticText>
    <reportElement x=”0″ y=”10″ width=”515″ height=”30″/>
    <textElement textAlignment=”Center” lineSpacing=”Single”>
    <font size=”22″/>
    </textElement>
    <text>Chart Sample</text>
    </staticText>
    <textField>
    <reportElement x=”0″ y=”50″ width=”515″ height=”50″/>
    <textElement textAlignment=”Center” lineSpacing=”Single”>
    <font size=”12″/>
    </textElement>
    <textFieldExpression>”This sample uses JFreeChart Version 0.9.2\n” + “Written by David Gilbert (david.gilbert@jrefinery.com) and others.\n” + “(C)opyright 2000-2002, by Simba Management Limited and Contributors.”</textFieldExpression>
    </textField>
    <image scaleImage=”Clip” hAlign=”Center”>
    <reportElement x=”0″ y=”110″ width=”515″ height=”515″/>
    <imageExpression class=”java.awt.Image”>$V{ChartImage}</imageExpression>
    </image>
    </band>
    </title>
    </jasperReport>

    #203059 Reply

    Riyad Kalla
    Member

    john,
    I just copy-pasted this into a new XML file and got code completion. What you can do is make sure your XML files are associated with the MyEclipse XML editor. Right click on your XML file and make sure it is opening with “XML Editor” that looks like a white piece of paper with a blue <x> on it.

    Also posting your software versions helps us too (if you are using a sufficiently old version of ME you may not have autocomplete. I’m using 2.7RC2)

    #203130 Reply

    Configuration:
    Eclipse V3.0 M4
    MyEclipse V 3.6.2
    Operating Systems: SuSE Linux 8.2
    Application Server: JBoss 3.2.1
    Number of Eclipse plugins starting with org.eclipse.pde.*: 14
    JDK to launch Eclipse: Sun j2sdk1.4.2
    JDK to launch your server: Sun j2sdk1.4.2

    Somehow I cannot get XML code completion working on the above platform.
    I open file with “XML Source Editor”.
    It is a white page with blue X icon in title bar
    Syntax coloring is working fine, but no code completion, which is quite useful when the DTD is complex like with Jasper Reports.

    #203135 Reply

    Riyad Kalla
    Member

    john,
    Is upgrading your installation of MyEclipse to 3.7RC2 an option? I’m not sure what version of MyEclipse added autocomplete to the XML editor, but I know in 2.7/3.7 it is there.

    #203168 Reply

    Could not find 3.7RC2 on download page, only 2.7RC2.
    The latter will probably only work with Eclipse 2 , right ?
    I can use Eclipse 2 if this solves the XML problem.
    Eclipse 3 M6 is not an option on Linux SWT/GTK : editing is way too slow.
    So either Eclipse 2 or Eclipse 3 M4.

    #203174 Reply

    Scott Anderson
    Participant

    John,

    The 3.7 RC2 download is in the folder marked ‘Registered Members Area’ in the download section since it’s not available for free trial users. Please bear in mind that it only works with Eclipse 3.0M6 so it doesn’t appear to be an option for you right now. In addition, when we release 3.7 GA in a couple of weeks, it will most likely work only on 3.0M7, depending on when the Eclipse team releases it.

    #203194 Reply

    I have made a clean install of:
    Eclipse 2.1.2 GTK for Linux
    MyClipse2.7RC2 : EnterpriseWorkbenchInstaller_020700RC2.bin

    XML code completion still not working.
    Both navigator and editor show blue “X” icon.
    My Eclipse HTML code completion is working correctly.
    There is one thing I noticed though:
    HTML file open with says: “MyEclipse HTML Editor”
    XML file open with says: “XML Editor”

    Is this a non MyEclipse XML editor ?

    #203201 Reply

    Riyad Kalla
    Member

    This is correct, the name for the XML editor wasn’t updated in time to include the “MyEclipse” part although it seems it should be.

    Do you have any other XML editor plugins installed, especially XMen or XMLBuddy? ME makes use of a highly customized version of the XMen plugin, so if you have it installed in addition to ME you might run into conflicts.

    I know you mentioned that this was a fresh install however which makes me doubt you DO have any other plugins installed. Are you behind a firewall or proxy? People have had problems with the XML editor pulling the DTD when in this situation, so autocomplete hadn’t worked…

    #203237 Reply

    There is a problem somewhere with my router.
    When I connect directly to the Internet with a dialup modem XML code completeion is working properly.
    Leaves the question: which ports do I have to open on the firewall to get XML code completion working ?

    #203243 Reply

    Riyad Kalla
    Member

    John let me check with Scott/Michael on this one.

    #203287 Reply

    Scott Anderson
    Participant

    Since the editor simply tries to download using http, as long as http access is provided by the router there shouldn’t be an issue. However, some software firewalls, like ZoneAlarm for example, will disallow internet access to applications unless you explicitly enable it. This sounds like what might be happening to you so it should be simply a process of enabling Eclipse to connect to the internet.

    #203318 Reply

    There is no firewall running on my Linux PC.
    To get to the bottom of this problem I have installed a brand new firewall, called IPCop.
    Still the same problem.
    However I can surf the web, get email effortless.
    IPCop does not limit any traffic coming out of the internal (GREEN) network, so HTTP traffic is not blocked in any way.
    To further narrow down the cause of the problem I have installed myEclipse 2.7RC2 on a Windows 2000 workstation.
    On Windows XML completion is working properly.
    This proofs that the problem is not in the firewall, because the Windows box is working properly.
    As my Linux box has unrestricted Internet access, this canot be the problem either.

    This leaves me to conclude that there must be something speific to the XML plugin on Linux which makes it not working behind a firewall.

    #203350 Reply

    Scott Anderson
    Participant

    This leaves me to conclude that there must be something speific to the XML plugin on Linux which makes it not working behind a firewall.

    Well, I don’t know if we know enough to conclude that. For example, one of our test machines is a Linux box behind a firewall and code completion is working properly on it. Is the failure to complete restricted one type of DTD? For example, can you use the XML wizard to create a sturts config file and then see if completion is working in it? This will be an interesting test since the struts dtd is shipped with MyEclipse so no network access is needed for completion. Also, please be sure the XML editor preferences are configured to use the DTD cache.

Viewing 15 posts - 1 through 15 (of 20 total)
Reply To: XML code comletion using DTD [Closed]

You must be logged in to post in the forum log in