Ticket #519 (closed defect: fixed)

Opened 2 years ago

Last modified 11 months ago

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

shortBad.xml Download (0.5 KB) - added by justinrowles 2 years ago.
Sample record which is valid but can't be edited.
update-fixed-info.xsl.patch Download (0.8 KB) - added by ianwallen 11 months ago.
Changed the patch so that it works a little better and is in line with the changes from ticket #957

Change History

Changed 2 years ago by justinrowles

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

Changed 16 months ago by pvgenuchten

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...")

Changed 11 months ago by ianwallen

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.

Changed 11 months ago by ianwallen

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

Changed 11 months ago by ianwallen

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.

Changed 11 months ago by ianwallen

  • status changed from new to closed
  • resolution set to fixed

Changed 11 months ago by justinrowles

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.)

Changed 11 months ago by ianwallen

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

Note: See TracTickets for help on using tickets.