Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#519 closed defect (fixed)

A valid record gets broken by editing

Reported by: justinrowles Owned by: geonetwork-devel@…
Priority: major Milestone: v2.6.5
Component: General Version: v2.6.4
Keywords: Cc:

Description

If the attached record, which is valid xml in iso19139, is uploaded and edited, the system will duplicate one line and break it.

Attachments (2)

shortBad.xml (562 bytes ) - added by justinrowles 13 years ago.
Sample record which is valid but can't be edited.
update-fixed-info.xsl.patch (783 bytes ) - added by ianwallen 12 years ago.
Changed the patch so that it works a little better and is in line with the changes from ticket #957

Download all attachments as: .zip

Change History (8)

by justinrowles, 13 years ago

Attachment: shortBad.xml added

Sample record which is valid but can't be edited.

comment:1 by pvgenuchten, 13 years ago

verified in 2.6.4 bug still available upload record, choose edit, choose cancel, choose xml-view -> organisation is doubled -> while opening mainenance in edit mode: XPathException : A sequence of more than one item is not allowed as the first argument of normalize-space() ("Agri-Food and Biosciences Inst...", "Agri-Food and Biosciences Inst...")

comment:2 by ianwallen, 12 years ago

The shortBad.xml file that is supplied is not a valid iso19139 file. It is however a valid XML file. The problem is related to the update-fixed-info.xsl which is not interpreting the gco:CharacterString properly when supplied as "CharacterString xmlns....".

Temporary quick fix is to turn off the "automatic fixes" in the "system configuration".

By doing "name()!='????'" in the xslt we are assuming that the name is fully qualified with the namespace attached. It seems better to no use special functions and simply use something like "not(self::???)" - this seems to have corrected the problem.

However I'm not an XLST expert so the fix should be tested.

by ianwallen, 12 years ago

Attachment: update-fixed-info.xsl.patch added

Changed the patch so that it works a little better and is in line with the changes from ticket #957

comment:3 by ianwallen, 12 years ago

A better way is to simply rewrite the xml using the namespace prefix. Otherwise there may be other usage of the "name()" on other elements that will be skipped as well.

comment:4 by ianwallen, 12 years ago

Resolution: fixed
Status: newclosed

comment:5 by justinrowles, 12 years ago

Just curious Ian, when you say the sample is not a valid iso19139 file, do you mean because it is incomplete?

If so, good-oh, that was deliberate ;-)

If not, in what way is it invalid? (I'm not aware of any requirement in iso19139 that the namespaces be aliased.)

comment:6 by ianwallen, 12 years ago

Yes, that is what I meant - it was incomplete.

Note: See TracTickets for help on using tickets.