1 |
Sven Vermeulen wrote: |
2 |
> Hi all |
3 |
> |
4 |
> Xavier kindly pointed me to a problem I'm now facing with the documentation |
5 |
> metadata that allows us to dynamically generate a documentation index. |
6 |
> |
7 |
> Now on to the issue: the XSLT code we use sources the linked documents to |
8 |
> get their version, summary, title, etc. As long as all documents exist, this |
9 |
> isn't a problem. However, when a document is removed from CVS, sourcing the |
10 |
> inexisting document yields a "Internal Server 500" error which just doesn't |
11 |
> look nice. |
12 |
> |
13 |
> However, when dealing with project-specific documentation (such as the |
14 |
> Hardened Docs), the responsibility of the document itself is in hands of the |
15 |
> project documentation developer, not ours. This also means that "they" will |
16 |
> undoubtedly (re)move their documents without prior notice to the |
17 |
> documentation team. Each such action will lead to a "Internal Server 500" |
18 |
> error. |
19 |
|
20 |
AxKit does. I have no idea whether that behaviour can be changed or not. |
21 |
Gorg makes an error 500 on all errors and warnings. |
22 |
*We* can easily change that. More about that later. |
23 |
|
24 |
> Their are a few solutions to this: |
25 |
> |
26 |
> We can implement any QA-tool on client-side ("repodoc") and keep asking all |
27 |
> developers to use repodoc to operate on xml files. Since they're usually |
28 |
> used to working with repoman, I don't think too much objections will be |
29 |
> stated. |
30 |
> |
31 |
> We can implement a QA-tool on server-side (extend the current XML-Checker) |
32 |
> that verifies if the removal of a file can happen (see if the file is listed |
33 |
> in the English metadoc.xml) and, if not, issue an error. |
34 |
> |
35 |
> We can request the used xml parsers on our webnodes to return an empty |
36 |
> node-set instead of generating an error and update our XSLT to verify if the |
37 |
> returned node-set is empty. If it is, ignore the document. We can then |
38 |
> create a new chapter in the overview-dyn.xml document that lists all |
39 |
> non-existing documents. |
40 |
> |
41 |
> This latter solution is possible with Xavier's gorg application but has the |
42 |
> drawback that any other issues with missing xml files (for instance, |
43 |
> checking a handbook that lacks some files) will need to be covered in the |
44 |
> XSLT as well. The advantage is however that a nicer error can be shown to |
45 |
> the user that has a bit more information. |
46 |
|
47 |
I would say all three to have several lines of defence. |
48 |
1) The server-side script must block on critical errors like a non-valid file. |
49 |
We could add a check on the link attribute. |
50 |
It could check other things but not get in the way of other devs, e.g. it |
51 |
should not block when a hardened doc is (re)moved just because it would break |
52 |
our metadoc but it could mail docs-team@.g.o (or a new docs-warning@g.o) about |
53 |
metadoc.xml needing some TLC whenever a listed document is being removed. |
54 |
Overhead would be minimal as files are not (re)moved very often. |
55 |
|
56 |
2) A client-side QA tool would be in our hands and could do miracles like: |
57 |
. checking/copying <version> & <date> elements in translations; |
58 |
. check/add the lang attribute; |
59 |
. check/fix the link attribute. |
60 |
Just keep throwing ideas of what it would need to do. |
61 |
|
62 |
3) About the "failed to load external entity {file.xml}" warning: |
63 |
We could make gorg return an empty xml file e.g. "<empty/>" to libxslt. That |
64 |
would make the warning completely disappear. |
65 |
IMHO, there is no need to go that far. The only reason gorg makes it an error |
66 |
500 is that AxKit does. I had originally made gorg ignore all warnings and use |
67 |
whatever comes back from the xslt processor. Gorg's cache can already handle |
68 |
missing dependencies and it makes a new html when a missing file is added. |
69 |
It would be rather trivial to add a parameter to gorg's config to make it |
70 |
ignore a list of given warnings and we would start with |
71 |
IgnoreWarnings=1549 |
72 |
|
73 |
Missing document()'ed files can be tested in xsl if needed: |
74 |
<xsl:variable name="M" select="document('month.xml')"/> |
75 |
<xsl:choose> |
76 |
<xsl:when test="$M"> |
77 |
<date><xsl:copy-of select="$M/datedata/months[@lang='fr']/month[6]"/></date> |
78 |
</xsl:when> |
79 |
<xsl:otherwise> |
80 |
<date>NONE!</date> |
81 |
</xsl:otherwise> |
82 |
</xsl:choose> |
83 |
|
84 |
|
85 |
1) and 3) can be implemented quickly. |
86 |
2) needs more specs |
87 |
|
88 |
|
89 |
With kind regards, |
90 |
-- |
91 |
/ Xavier Neys |
92 |
\_ Gentoo Documentation Project |
93 |
/ French & Internationalisation Lead |
94 |
\ http://www.gentoo.org/doc/en |
95 |
/\ |