Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[smila-dev] Header info in XML files vs. xml w3c standards

Hi,

Remark :
Based on the http://wiki.eclipse.org/SMILA/Legal_Documentation - every source file (which includes Java source as well other types of files such as XML, HTML, etc.) must have a Copyright and License Notice.

Issue:
By adding the header to the XML files ( using xml comment tag block <!-- Copyright (c) 2008....... -->) a parser exceptions occurs (at least this happens in the xml storage bundles DefaultXssConfig.xml) :
javax.xml.bind.UnmarshalException...
Caused by: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

Cause:
This is because the XML file is programmatically validated against an xsd schema (at least in the xmlstorage bundles case - XssConfig.xsd schema is used) . For XML files that need to be validated it is not allowed to insert a block comment (like in our case the copyright information) before the first <?xml version="1.0" encoding="UTF-8"?> line.

This is also mentioned by the xml w3c standards http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-prolog

Question:
In this case first question would be : it is fine to insert the copyright info. not in the top of the xml file ? (I guess the validation shall always be performed in many cases...so not validating the xml is not an option)

Suggestions:
1.  instead of
<!-- *********************************************************************************************************************** * Copyright (c) 2008 empolis GmbH and brox IT Solutions GmbH. All rights reserved. This program and the accompanying
............................................
**********************************************************************************************************************/ --><?xml version="1.0" encoding="UTF-8"?><XssConfig xmlns="org.eclipse.eilf.xmlstorage.XssConfig/0.5"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="org.eclipse.eilf.xmlstorage.XssConfig/0.5................we could use (so the first line is always <?xml version="1.0"encoding="UTF-8"?>):<?xml version="1.0" encoding="UTF-8"?><!--*********************************************************************************************************************** * Copyright (c) 2008 empolis GmbH and brox IT Solutions GmbH. All rightsreserved. This program and the accompanying................................ **********************************************************************************************************************/ --><XssConfig xmlns="org.eclipse.eilf.xmlstorage.XssConfig/0.5"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="org.eclipse.eilf.xmlstorage.XssConfig/0.5.....................................................2. pre-processing operation before validation (not a good solution)Best Regards,Marius----- Original Message -----From: <smila-dev-request@xxxxxxxxxxx>To: <smila-dev@xxxxxxxxxxx>Sent: Thursday, September 25, 2008 3:28 PMSubject: smila-dev Digest, Vol 3, Issue 18> Send smila-dev mailing list submissions to> smila-dev@xxxxxxxxxxx>> To subscribe or unsubscribe via the World Wide Web, visit> https://dev.eclipse.org/mailman/listinfo/smila-dev> or, via email, send a message with subject or body 'help' to> smila-dev-request@xxxxxxxxxxx>> You can reach the person managing the list at> smila-dev-owner@xxxxxxxxxxx>> When replying, please edit your Subject line so it is more specific> than "Re: Contents of smila-dev digest...">>> Today's Topics:>>   1. tool for EPL source headers (Thomas Menzel)>   2. org.eclipse.equinox.ds and utils (Ivan Churkin)>   3. epl source header vs. generated code (Thomas Menzel)>   4. RE: org.eclipse.equinox.ds and utils (Thomas Menzel)>>> ---------------------------------------------------------------------->> Message: 1> Date: Thu, 25 Sep 2008 12:54:27 +0200> From: Thomas Menzel <tmenzel@xxxxxxx>> Subject: [smila-dev] tool for EPL source headers> To: Smila project developer mailing list <smila-dev@xxxxxxxxxxx>> Message-ID:> <6CDC32AFFBA5AA4B8BEA6397594F76BD1FA018F3E2@xxxxxxxxxxxxxxxxxxxxxxx>> Content-Type: text/plain; charset="us-ascii">> hi fellow-suffers,>> i guess i state the obvious that no one is really excited about the taskto add the EPL header to ALL source files.>> and I wonder if we can automate it with a tool that either exists or wemay write on our own.> before we dive into this: I wonder if it is worth it.> hence the question: how far along are u with this task and do u think itis worth to invest the time.>> I see two main functions for this tool that should work for the mostcommon source files, e.g. .java, .properties, .xml (and other xml docs suchas .xsd)>> a)      check if the header is present and correct> if not: flag/report the file>> b)      add EPL headers to files. this would need to be parameterized tosome extend, e.g. the initial contributor.>> for b) I at least see continuous need to avoid having to do this manuallyall the time even after initial contribution.>> I would also do a fairly simple implementation, such as a>> a)      normalize target EPL header to A>> b)      normalize file to be checked to B>> c)       text search A in B> normalize would mean: strip out all non alpha-numeric chars includingwhitespace.>> so, what is ur idea on the subject?>> PS: the eclipse plugin javadoc can also generate the file headers, if noneare present.>> -          but this only for java files (AFAIK)>> -          and wont correct any present header either>>>> Kind regards> Thomas Menzel> brox IT-Solutions GmbH>> -------------- next part --------------> An HTML attachment was scrubbed...> URL:https://dev.eclipse.org/mailman/private/smila-dev/attachments/20080925/a3fc1811/attachment.html>> ------------------------------>> Message: 2> Date: Thu, 25 Sep 2008 18:44:14 +0700> From: Ivan Churkin <ivan@xxxxxxxxxxxx>> Subject: [smila-dev] org.eclipse.equinox.ds and utils> To: Smila project developer mailing list <smila-dev@xxxxxxxxxxx>> Message-ID: <48DB798E.1080303@xxxxxxxxxxxx>> Content-Type: text/plain; charset=UTF-8; format=flowed>> Hi folks,>> I suggest to compile> org.eclipse.equinox.ds and org.eclipse.equinox.util> and to move them into EILF.extension because its not a part of ourproject.>> --> Ivan>>>> ------------------------------>> Message: 3> Date: Thu, 25 Sep 2008 14:20:59 +0200> From: Thomas Menzel <tmenzel@xxxxxxx>> Subject: [smila-dev] epl source header vs. generated code> To: Smila project developer mailing list <smila-dev@xxxxxxxxxxx>> Message-ID:> <6CDC32AFFBA5AA4B8BEA6397594F76BD1FA018F3EC@xxxxxxxxxxxxxxxxxxxxxxx>> Content-Type: text/plain; charset="us-ascii">> hi again,>> sonya, who is working on the legal stuff wiki, asked me today if we shouldalso head EPL headers to generated code.> hm, good question!>> currently we check in the generated code having avoided this step toinclude into our build - which was a good thing b/c it safes time.>> since we would now need to add the EPL headers to the code I wonder if weshould change that or leave it as is.> checking in would mean that either the generation tool lets us add theheader by way of configuration or we would have to do this manually.> if the latter, I'd say we should generate the code during build as I don'tlike having to edit a generated file by hand and then use it.>> so far I know that we have code generated with JAXB but I don't know(anymore) if it will let us add the header or not.> do we generate any other code?>> in case the code needs to generated during build, then this would need togo IMO into a bundle's specific build file.> (how this is done will be answered by ralf if there is the need on thismail thread and hopefully too in wiki/dev. guide).>> so these are the questions that u need to answer (for the code u have beenassigned)>> a)      do I have generated to code?>> a.       yes:> does the generator support custom file headers to put it the EPL?>>                                                               i.      yes:> do so and keep the generated source in SVN>>                                                             ii.      no:> add specific bundle build step to generate ur code>>> Kind regards> Thomas Menzel> brox IT-Solutions GmbH>> -------------- next part --------------> An HTML attachment was scrubbed...> URL:https://dev.eclipse.org/mailman/private/smila-dev/attachments/20080925/ecda451c/attachment.html>> ------------------------------>> Message: 4> Date: Thu, 25 Sep 2008 14:26:02 +0200> From: Thomas Menzel <tmenzel@xxxxxxx>> Subject: RE: [smila-dev] org.eclipse.equinox.ds and utils> To: Smila project developer mailing list <smila-dev@xxxxxxxxxxx>> Message-ID:> <6CDC32AFFBA5AA4B8BEA6397594F76BD1FA018F3EF@xxxxxxxxxxxxxxxxxxxxxxx>> Content-Type: text/plain; charset="utf-8">> good idea!>> vote +1>> but why wasnt that done from the beginning?>> Kind regards> Thomas Menzel> brox IT-Solutions GmbH>>> -----Original Message-----> From: smila-dev-bounces@xxxxxxxxxxx [mailto:smila-dev-bounces@xxxxxxxxxxx]On Behalf Of Ivan Churkin> Sent: Donnerstag, 25. September 2008 13:44> To: Smila project developer mailing list> Subject: [smila-dev] org.eclipse.equinox.ds and utils>> Hi folks,>> I suggest to compile> org.eclipse.equinox.ds and org.eclipse.equinox.util> and to move them into EILF.extension because its not a part of ourproject.>> --> Ivan>> _______________________________________________> smila-dev mailing list> smila-dev@xxxxxxxxxxx> https://dev.eclipse.org/mailman/listinfo/smila-dev>> ------------------------------>> _______________________________________________> smila-dev mailing list> smila-dev@xxxxxxxxxxx> https://dev.eclipse.org/mailman/listinfo/smila-dev>>> End of smila-dev Digest, Vol 3, Issue 18> ****************************************>>



Back to the top