Skip to content

Commit

Permalink
RISDEV-5168 (#2420)
Browse files Browse the repository at this point in the history
* RISDEV-5168

Adjustment structure LDML-R
*Fixing minor bugs found during re-export of all caselaw in the database

* RISDEV-5168

Adjustment structure LDML-R
*Fixing minor bugs found during re-export of all caselaw in the database

* RISDEV-5168

Adjustment structure LDML-R
*Fixing minor bugs found during re-export of all caselaw in the database
  • Loading branch information
andrew-cenkner-digitalservice authored Dec 17, 2024
1 parent e2f9ba6 commit adb7bc4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ private void logXsdError(String caseLawId, String beforeXslt, Exception e) {
hint = "KARE600062214 contains an invalid width (escaping issue)";
} else if (beforeXslt.contains("JURE200002538")) {
hint = "JURE200002538 contains an invalid href (invalid whitespace in the middle of the url)";
} else if (beforeXslt.matches("(?s).*<akn:header>.*<div.*</akn:header>.*")) {
hint = "Ldml contained <div> inside title.";
} else if (beforeXslt.matches("(?s).*<akn:header>.*<br.*</akn:header>.*")) {
hint = "Ldml contained <br> inside title.";
}
logger.error("Error: {} Case Law {} does not match akomantoso30.xsd. {}", hint, caseLawId, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlTransient;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
public class AknMultipleBlock {

// Jaxb doesn't handle elements with the same name very well.
// They need to be in a list with the same class instead of two separate fields.
// A Map is used with @XmlElement added to a helper getter/setter to facilitate easier use.
@XmlTransient private Map<String, AknBlock> blocks;
@XmlTransient private Map<String, AknBlock> blocks = new LinkedHashMap<>();

@XmlElement(name = "block", namespace = CaseLawLdml.AKN_NS)
public void setJaxbBlocks(List<AknBlock> blocks) {
Expand All @@ -28,10 +30,6 @@ public List<AknBlock> getJaxbBlocks() {
return new ArrayList<>(blocks.values());
}

public AknMultipleBlock() {
this.blocks = new HashMap<>();
}

public AknMultipleBlock withBlock(String name, AknBlock block) {
if (block != null) {
blocks.put(name, block);
Expand Down

This file was deleted.

11 changes: 5 additions & 6 deletions backend/src/main/resources/caselawhandover/htmlToAknHtml.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
</xsl:template>

<!--Case Law team handover: decide how to transform these internal Juris image markers into html links -->
<xsl:template match="hfj" mode="firstPass">
<xsl:apply-templates mode="firstPass"/>
</xsl:template>
<xsl:template match="hfj" mode="firstPass"/>

<!--Case Law team handover: Validate that removing this tag is okay. Example caselas is WBRE410020500
The current web view https://eur-lex.europa.eu/legal-content/DE/TXT/?uri=CELEX%3A62013CA0192
Expand Down Expand Up @@ -81,8 +79,9 @@

<!--Unsupported attributes are renamed to the ris namespace. These attributes are verified to not be
supported by checking the xsd since the website documentation has no easy way to check this-->
<xsl:template match="@id|@scope|@span|@valign|@headers|@nr|@frame|colgroup/col/@width|span/@lang|
table/@cellpadding|table/@cellspacing|a/@name|a/@shape|@cite|@datetime|blockquote/@dir">
<xsl:template match="@id|@scope|@span|@valign|@align|@headers|@nr|@frame|colgroup/col/@width|
span/@lang|table/@cellpadding|table/@cellspacing|a/@name|a/@shape|@cite|@datetime|
blockquote/@dir|table/@rules|table/@summary">
<xsl:attribute name="ris:{name()}">
<xsl:value-of select="." />
</xsl:attribute>
Expand Down Expand Up @@ -242,7 +241,7 @@
</akn:foreign>
</xsl:template>

<xsl:template match="colgroup|col|tbody|th|tr|td">
<xsl:template match="colgroup|col|tbody|th|tr|td|thead|tfoot">
<xsl:element name="ris:{name()}">
<xsl:apply-templates select="@* | node()"/>
</xsl:element>
Expand Down

0 comments on commit adb7bc4

Please sign in to comment.