- This topic has 6 replies, 5 voices, and was last updated 19 years, 5 months ago by Riyad Kalla.
-
AuthorPosts
-
mikewseMemberI can’t get this to work with my “problem” DTDs, but maybe I have a different scenario as my DTDs are not available at any http locations. Description:
log4j.dtd
———-
This is bundled inside log4j.jar and used by our log4j.xml settings files with a standard heading of:
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<!DOCTYPE log4j:configuration SYSTEM “log4j.dtd”>
<log4j:configuration xmlns:log4j=”http://jakarta.apache.org/log4j/”>configuration-1.0.dtd
————————
This is our own dtd used by our application settings files with a heading like:
<!DOCTYPE app-configuration PUBLIC “-//App/Configuration DTD 1.0//EN”
“configuration-1.0.dtd”>Both of these dtds annoy me with red crosses inside Eclipse for the files using them and I would very much like to get rid of these errors, plus of course get auto-completion working.
I have tried putting copies of the dtds inside
eclipse\plugins\com.genuitec.eclipse.xmen_3.8.1\dtd
and have tried different combinations of prefixes but to no avail. Maybe you can try with the log4j dtd and tell me how you get it done?Cheers Mike
Scott AndersonParticipantMike,
You didn’t provide any context information, as we request in the Posting Guidelines thread at the top of this forum, so I’ll answer your question assuming you’re using MyEclipse 3.8.2.
What you need to do is add your custom DTDs to the XML Catalog located at Window > Preferences > MyEclipse > Editors > XML > XML Catalog. Once they’re added properly there, the validator and code assist modules will be able to use them effectively.
mikewseMemberHi Scott,
> assuming you’re using MyEclipse 3.8.2.
Yes, that’s right. Sorry for forgetting that. Actually, I was posting this as a followup on the thread “No proxy support [Closed]” (http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-1263.html) where the last posts were discussing 3.8.2, but for some reason the BB put my post as a new thread…
> add your custom DTDs to the XML Catalog
Thanks! Great, this was a function a thought was missing. I had browsed through the XML Editor settings but for some reason the “XML Catalog” heading didn’t ring a bell for me (was looking for DTD, schema, etc).
Adding the DTDs in these settings corrected the problem for our own application DTD, but not for log4j. I think the difference may lie in the format of the DTD key as our own application DTD has a key on the format -//blabla/blabla//EN but log4j uses a different syntax. Or it is the PUBLIC/SYSTEM difference. This is the standard log4j header:
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<!DOCTYPE log4j:configuration SYSTEM “log4j.dtd”>
<log4j:configuration xmlns:log4j=”http://jakarta.apache.org/log4j/”>And I have thus added an XML Catalog entry like this:
URI: defslog4j/lib/log4j.dtd
Key Type: System ID
Key: log4j.dtdBut I still get a red cross with “file not found” on the DOCTYPE line, where the path it’s looking for is ending with WEB-INF/classes.
BTW: I have found a bug in the Edit XML Catalog Entry dialog box; when editing an entry with Key Type = SYSTEM ID it pops up showing PUBLIC ID as preselected.
Cheers / Mike
mikewseMemberHi, haven’t heard from you about this…
Best regards
Mike
dgtaleMemberHi mikewse
I had the same problem solved in this way:1. Apply this code in your log4jconfig.xml
<!DOCTYPE log4j:configuration PUBLIC "-//LOGGER" "log4j.dtd">
2. Then add your custom PUBBLIC DTDs to the XML Catalog located at Window > Preferences > MyEclipse > Editors > XML > XML Catalog (using the key “-//LOGGER”).
Here (http://www.xml.com/lpt/a/2002/09/04/xslt.html) you can find some info about how the parser works:
If it can't find PUBLIC, the parser uses the SYSTEM identifier following the PUBLIC identifier. The SYSTEM identifier doesn't need the word "SYSTEM" -- because it's a required parameter, the XML parser knows what it is.
This means that MyEclipse uses the PUBLIC identifier, while in runtime the parser uses the SYSTEM
jakegageMemberHey there,
I’d like to try this solution, but I don’t see references to “log4jconfig.xml” anywhere. Is this just another name for “log4j.xml”?
Jake
Riyad KallaMemberMost likely, yes.
-
AuthorPosts