sb2008 / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

repo should provide a valid DTD #140

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I'm trying to automate the validity check and formatting of manifest files 
using "xmllint" from "libxml2".

Using the documentation, I've found a prototype of a DTD that should match the 
content of manifest files ... but it's not in shape to validate the XML written 
in manifest files:

https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.txt

Here're some errors:

test1.xml:2: element manifest: validity error : Element manifest content does 
not follow the DTD, expecting (notice? , remote* , default? , manifest-server? 
, remove-project* , project* , repo-hooks?), got (include include include 
include include include include include include include include include include 
include include include include include include include include include include 
include include include include include include include include include include 
include include include)
test1.xml:3: element include: validity error : Element include content does not 
follow the DTD, expecting (EMPTY), got
test1.xml:4: element include: validity error : Element include content does not 
follow the DTD, expecting (EMPTY), got
Document test1.xml does not validate against manifest.dtd

test2.xml:3: element remote: validity error : Element remote content does not 
follow the DTD, expecting (EMPTY), got
test2.xml:4: element remote: validity error : Element remote content does not 
follow the DTD, expecting (EMPTY), got
Document test2.xml does not validate against manifest.dtd

test3.xml:3: element project: validity error : Element project content does not 
follow the DTD, expecting (annotation? , project*), got (annotation annotation)
test3.xml:4: element annotation: validity error : Element annotation content 
does not follow the DTD, expecting (EMPTY), got
test3.xml:3: element project: validity error : IDREF attribute remote 
references an unknown ID "myremote"
Document test3.xml does not validate against manifest.dtd

git-repo should publish somewhere a valid DTD so that it will possible to check 
beforehand for validity of manifest files.

Regards.

Original issue reported on code.google.com by yann@droneaud.fr on 28 May 2013 at 9:38

GoogleCodeExporter commented 9 years ago
Please a find a patch that try to address the error listed previously.
As I'm not an expert in the art of writing DTD, it should be reviewed carefully.

At least, I'm able to validate manifest files that are actually used by 
git-repo.

Original comment by yann@droneaud.fr on 28 May 2013 at 9:55

Attachments:

GoogleCodeExporter commented 9 years ago
BTW, the android's manifests doesn't validate against my modified DTD:

default.xml:11: element project: validity error : Element project content does 
not follow the DTD, expecting (annotation* , project*), got (copyfile )
default.xml:12: element copyfile: validity error : No declaration for element 
copyfile
default.xml:12: element copyfile: validity error : No declaration for attribute 
src of element copyfile
default.xml:12: element copyfile: validity error : No declaration for attribute 
dest of element copyfile
Document default.xml does not validate against manifest.dtd

Original comment by yann@droneaud.fr on 28 May 2013 at 10:12

GoogleCodeExporter commented 9 years ago
Please a find an updated DTD that matches my manifest and android's manifests.

Regards.

Original comment by yann@droneaud.fr on 28 May 2013 at 1:23

Attachments: