Skip to content

Commit

Permalink
#3549: stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Nov 25, 2024
1 parent 772d440 commit 424237c
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ SOFTWARE.
time="2024-05-16T14:27:19.832605Z"
version="0.0.0">
<listing>yv66vgAAADcAHAoAAgADBwAEDAAFAAYBABBqYXZhL2xhbmcvT2JqZWN0AQAGPGluaXQ+AQADKClWCQAIAAkHAAoMAAsADAEAFm9yZy9lb2xhbmcvYmVuY2htYXJrL0IBAAFmAQAYTG9yZy9lb2xhbmcvYmVuY2htYXJrL0Y7CwAOAA8HABAMABEAEgEAFm9yZy9lb2xhbmcvYmVuY2htYXJrL0YBAANmb28BAAMoKUkBABsoTG9yZy9lb2xhbmcvYmVuY2htYXJrL0Y7KVYBAARDb2RlAQAPTGluZU51bWJlclRhYmxlAQASTG9jYWxWYXJpYWJsZVRhYmxlAQAEdGhpcwEAGExvcmcvZW9sYW5nL2JlbmNobWFyay9COwEAA2JhcgEAClNvdXJjZUZpbGUBAAZCLmphdmEAIAAIAAIAAAABABIACwAMAAAAAgAAAAUAEwABABQAAABGAAIAAgAAAAoqtwABKiu1AAexAAAAAgAVAAAADgADAAAAHAAEAB0ACQAeABYAAAAWAAIAAAAKABcAGAAAAAAACgALAAwAAQAAABkAEgABABQAAAA2AAIAAQAAAAwqtAAHuQANAQAFYKwAAAACABUAAAAGAAEAAAAgABYAAAAMAAEAAAAMABcAGAAAAAEAGgAAAAIAGw==</listing>
<errors/>
<sheets/>
<license/>
<metas>
<meta>
<head>package</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ SOFTWARE.
-->
<program dob="2024-03-13T13:49:54.999144Z" ms="1710337794999" name="j$OriginalException" revision="0.0.0" time="2024-03-13T13:49:54.999144Z" version="0.0.0">
<listing>yv66vgAAADQAFwoAAgADBwAEDAAFAAYBABpqYXZhL2xhbmcvUnVudGltZUV4Y2VwdGlvbgEABjxpbml0PgEAFShMamF2YS9sYW5nL1N0cmluZzspVgoAAgAIDAAFAAkBACooTGphdmEvbGFuZy9TdHJpbmc7TGphdmEvbGFuZy9UaHJvd2FibGU7KVYHAAsBAChvcmcvZW9sYW5nL2luaGVyaXRhbmNlL09yaWdpbmFsRXhjZXB0aW9uAQAEQ29kZQEAD0xpbmVOdW1iZXJUYWJsZQEAEkxvY2FsVmFyaWFibGVUYWJsZQEABHRoaXMBACpMb3JnL2VvbGFuZy9pbmhlcml0YW5jZS9PcmlnaW5hbEV4Y2VwdGlvbjsBAAdtZXNzYWdlAQASTGphdmEvbGFuZy9TdHJpbmc7AQAFY2F1c2UBABVMamF2YS9sYW5nL1Rocm93YWJsZTsBAApTb3VyY2VGaWxlAQAWT3JpZ2luYWxFeGNlcHRpb24uamF2YQAgAAoAAgAAAAAAAgABAAUABgABAAwAAAA+AAIAAgAAAAYqK7cAAbEAAAACAA0AAAAKAAIAAAAdAAUAHgAOAAAAFgACAAAABgAPABAAAAAAAAYAEQASAAEAAQAFAAkAAQAMAAAASQADAAMAAAAHKisstwAHsQAAAAIADQAAAAoAAgAAACEABgAiAA4AAAAgAAMAAAAHAA8AEAAAAAAABwARABIAAQAAAAcAEwAUAAIAAQAVAAAAAgAW</listing>
<errors/>
<sheets/>
<license/>
<metas>
<meta>
<head>package</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ SOFTWARE.
time="2024-03-13T13:49:54.981860Z"
version="0.0.0">
<listing>yv66vgAAADQAHAoAAgADBwAEDAAFAAYBAChvcmcvZW9sYW5nL2luaGVyaXRhbmNlL09yaWdpbmFsRXhjZXB0aW9uAQAGPGluaXQ+AQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgACAAgMAAUACQEAKihMamF2YS9sYW5nL1N0cmluZztMamF2YS9sYW5nL1Rocm93YWJsZTspVgcACwEAJG9yZy9lb2xhbmcvaW5oZXJpdGFuY2UvU29tZUV4Y2VwdGlvbgEAEHNlcmlhbFZlcnNpb25VSUQBAAFKAQANQ29uc3RhbnRWYWx1ZQX////////P6QEABENvZGUBAA9MaW5lTnVtYmVyVGFibGUBABJMb2NhbFZhcmlhYmxlVGFibGUBAAR0aGlzAQAmTG9yZy9lb2xhbmcvaW5oZXJpdGFuY2UvU29tZUV4Y2VwdGlvbjsBAAFzAQASTGphdmEvbGFuZy9TdHJpbmc7AQABdAEAFUxqYXZhL2xhbmcvVGhyb3dhYmxlOwEAClNvdXJjZUZpbGUBABJTb21lRXhjZXB0aW9uLmphdmEAIAAKAAIAAAABABoADAANAAEADgAAAAIADwACAAEABQAGAAEAEQAAADoAAgACAAAABiortwABsQAAAAIAEgAAAAYAAQAAAB4AEwAAABYAAgAAAAYAFAAVAAAAAAAGABYAFwABAAEABQAJAAEAEQAAAEUAAwADAAAAByorLLcAB7EAAAACABIAAAAGAAEAAAAgABMAAAAgAAMAAAAHABQAFQAAAAAABwAWABcAAQAAAAcAGAAZAAIAAQAaAAAAAgAb</listing>
<errors/>
<sheets/>
<license/>
<metas>
<meta>
<head>package</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ SOFTWARE.
time="2024-03-15T08:31:41.639381Z"
version="0.0.0">
<listing>yv66vgAAADQACwcAAgEAHW9yZy9lb2xhbmcvaW5uZXJjbGFzc2VzL1RvcCQxBwAEAQAQamF2YS9sYW5nL09iamVjdAEAClNvdXJjZUZpbGUBAAhUb3AuamF2YQEAD0VuY2xvc2luZ01ldGhvZAcACQEAG29yZy9lb2xhbmcvaW5uZXJjbGFzc2VzL1RvcAEADElubmVyQ2xhc3NlcxAgAAEAAwAAAAAAAAADAAUAAAACAAYABwAAAAQACAAAAAoAAAAKAAEAAQAAAAAQCA==</listing>
<errors/>
<sheets/>
<license/>
<metas>
<meta>
<head>package</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ SOFTWARE.
time="2024-03-15T08:31:41.601770Z"
version="0.0.0">
<listing>yv66vgAAADQALwoAAgADBwAEDAAFAAYBACxvcmcvZW9sYW5nL2lubmVyY2xhc3Nlcy9Ub3AkVG9wSW5uZXJJbnN0YW5jZQEABjxpbml0PgEAIChMb3JnL2VvbGFuZy9pbm5lcmNsYXNzZXMvVG9wOylWCQACAAgMAAkACgEABnRoaXMkMAEAHUxvcmcvZW9sYW5nL2lubmVyY2xhc3Nlcy9Ub3A7CgAMAA0HAA4MAAUADwEAEGphdmEvbGFuZy9PYmplY3QBAAMoKVYJABEAEgcAEwwAFAAVAQAQamF2YS9sYW5nL1N5c3RlbQEAA291dAEAFUxqYXZhL2lvL1ByaW50U3RyZWFtOwgAFwEAEFRvcElubmVySW5zdGFuY2UKABkAGgcAGwwAHAAdAQATamF2YS9pby9QcmludFN0cmVhbQEAB3ByaW50bG4BABUoTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51bWJlclRhYmxlAQASTG9jYWxWYXJpYWJsZVRhYmxlAQAEdGhpcwEALkxvcmcvZW9sYW5nL2lubmVyY2xhc3Nlcy9Ub3AkVG9wSW5uZXJJbnN0YW5jZTsBAAVwcmludAEAPyhMb3JnL2VvbGFuZy9pbm5lcmNsYXNzZXMvVG9wO0xvcmcvZW9sYW5nL2lubmVyY2xhc3Nlcy9Ub3AkMTspVgEAAngwAQACeDEBAB9Mb3JnL2VvbGFuZy9pbm5lcmNsYXNzZXMvVG9wJDE7AQAKU291cmNlRmlsZQEACFRvcC5qYXZhAQAMSW5uZXJDbGFzc2VzBwAsAQAbb3JnL2VvbGFuZy9pbm5lcmNsYXNzZXMvVG9wBwAuAQAdb3JnL2VvbGFuZy9pbm5lcmNsYXNzZXMvVG9wJDEAIAACAAwAAAABEBAACQAKAAAAAwACAAUABgABAB4AAAA0AAIAAgAAAAoqK7UAByq3AAuxAAAAAgAfAAAABgABAAAAJwAgAAAADAABAAAACgAhACIAAAABACMADwABAB4AAAA3AAIAAQAAAAmyABASFrYAGLEAAAACAB8AAAAKAAIAAAApAAgAKgAgAAAADAABAAAACQAhACIAABAAAAUAJAABAB4AAABEAAIAAwAAAAYqK7cAAbEAAAACAB8AAAAGAAEAAAAnACAAAAAgAAMAAAAGACEAIgAAAAAABgAlAAoAAQAAAAYAJgAnAAIAAgAoAAAAAgApACoAAAASAAIAAgArABcAAgAtAAAAABAI</listing>
<errors/>
<sheets/>
<license/>
<metas>
<meta>
<head>package</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ SOFTWARE.
time="2024-03-15T08:31:41.622375Z"
version="0.0.0">
<listing>yv66vgAAADQAKAoAAgADBwAEDAAFAAYBACpvcmcvZW9sYW5nL2lubmVyY2xhc3Nlcy9Ub3AkVG9wSW5uZXJTdGF0aWMBAAY8aW5pdD4BAAMoKVYKAAgAAwcACQEAEGphdmEvbGFuZy9PYmplY3QJAAsADAcADQwADgAPAQAQamF2YS9sYW5nL1N5c3RlbQEAA291dAEAFUxqYXZhL2lvL1ByaW50U3RyZWFtOwgAEQEADlRvcElubmVyU3RhdGljCgATABQHABUMABYAFwEAE2phdmEvaW8vUHJpbnRTdHJlYW0BAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWAQAEQ29kZQEAD0xpbmVOdW1iZXJUYWJsZQEAEkxvY2FsVmFyaWFibGVUYWJsZQEABHRoaXMBACxMb3JnL2VvbGFuZy9pbm5lcmNsYXNzZXMvVG9wJFRvcElubmVyU3RhdGljOwEABXByaW50AQAiKExvcmcvZW9sYW5nL2lubmVyY2xhc3Nlcy9Ub3AkMTspVgEAAngwAQAfTG9yZy9lb2xhbmcvaW5uZXJjbGFzc2VzL1RvcCQxOwEAClNvdXJjZUZpbGUBAAhUb3AuamF2YQEADElubmVyQ2xhc3NlcwcAJQEAG29yZy9lb2xhbmcvaW5uZXJjbGFzc2VzL1RvcAcAJwEAHW9yZy9lb2xhbmcvaW5uZXJjbGFzc2VzL1RvcCQxACAAAgAIAAAAAAADAAIABQAGAAEAGAAAAC8AAQABAAAABSq3AAexAAAAAgAZAAAABgABAAAAIQAaAAAADAABAAAABQAbABwAAAABAB0ABgABABgAAAA3AAIAAQAAAAmyAAoSELYAErEAAAACABkAAAAKAAIAAAAjAAgAJAAaAAAADAABAAAACQAbABwAABAAAAUAHgABABgAAAA5AAEAAgAAAAUqtwABsQAAAAIAGQAAAAYAAQAAACEAGgAAABYAAgAAAAUAGwAcAAAAAAAFAB8AIAABAAIAIQAAAAIAIgAjAAAAEgACAAIAJAARAAoAJgAAAAAQCA==</listing>
<errors/>
<sheets/>
<license/>
<metas>
<meta>
<head>package</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ SOFTWARE.
time="2024-03-15T08:31:41.577795Z"
version="0.0.0">
<listing>yv66vgAAADQAIwoAAgADBwAEDAAFAAYBABBqYXZhL2xhbmcvT2JqZWN0AQAGPGluaXQ+AQADKClWBwAIAQAqb3JnL2VvbGFuZy9pbm5lcmNsYXNzZXMvVG9wJFRvcElubmVyU3RhdGljCgAHAAoMAAUACwEAIihMb3JnL2VvbGFuZy9pbm5lcmNsYXNzZXMvVG9wJDE7KVYKAAcADQwADgAGAQAFcHJpbnQHABABACxvcmcvZW9sYW5nL2lubmVyY2xhc3Nlcy9Ub3AkVG9wSW5uZXJJbnN0YW5jZQoADwASDAAFABMBAD8oTG9yZy9lb2xhbmcvaW5uZXJjbGFzc2VzL1RvcDtMb3JnL2VvbGFuZy9pbm5lcmNsYXNzZXMvVG9wJDE7KVYKAA8ADQcAFgEAG29yZy9lb2xhbmcvaW5uZXJjbGFzc2VzL1RvcAEABENvZGUBAA9MaW5lTnVtYmVyVGFibGUBABJMb2NhbFZhcmlhYmxlVGFibGUBAAR0aGlzAQAdTG9yZy9lb2xhbmcvaW5uZXJjbGFzc2VzL1RvcDsBAApTb3VyY2VGaWxlAQAIVG9wLmphdmEBAAxJbm5lckNsYXNzZXMBAA5Ub3BJbm5lclN0YXRpYwcAIQEAHW9yZy9lb2xhbmcvaW5uZXJjbGFzc2VzL1RvcCQxAQAQVG9wSW5uZXJJbnN0YW5jZQAhABUAAgAAAAAAAgABAAUABgABABcAAAAvAAEAAQAAAAUqtwABsQAAAAIAGAAAAAYAAQAAABoAGQAAAAwAAQAAAAUAGgAbAAAAAQAOAAYAAQAXAAAASgAEAAEAAAAYuwAHWQG3AAm2AAy7AA9ZKgG3ABG2ABSxAAAAAgAYAAAADgADAAAAHQALAB4AFwAfABkAAAAMAAEAAAAYABoAGwAAAAIAHAAAAAIAHQAeAAAAGgADAAcAFQAfAAoAIAAAAAAQCAAPABUAIgAC</listing>
<errors/>
<sheets/>
<license/>
<metas>
<meta>
<head>package</head>
Expand Down
8 changes: 5 additions & 3 deletions eo-parser/src/main/java/org/eolang/parser/ParsingErrors.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ public Iterator<Directive> iterator() {
return new org.cactoos.iterable.Joined<>(
new Mapped<Iterable<Directive>>(
error -> new Directives()
.xpath("/program/errors")
.xpath("/program")
.strict(1)
.addIf("errors")
.strict(1)
.add("error")
.attr("line", error.line())
.attr("severity", "critical")
.set(error.getMessage())
.up(),
.set(error.getMessage()),
this.errors
)
).iterator();
Expand Down
2 changes: 1 addition & 1 deletion eo-parser/src/main/java/org/eolang/parser/TrStepped.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class TrStepped extends TrEnvelope {
* Apply changes to each XML after processing.
*/
private static final XSL EACH = new XSLDocument(
TrStepped.class.getResourceAsStream("_each.xsl"),
TrStepped.class.getResourceAsStream("_stepped.xsl"),
"each.xsl"
).with(new ClasspathSources(TrStepped.class));

Expand Down
8 changes: 2 additions & 6 deletions eo-parser/src/main/java/org/eolang/parser/XeEoListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,13 @@ public void enterProgram(final EoParser.ProgramContext ctx) {
DateTimeFormatter.ISO_INSTANT
)
)
.add("listing").set(new SourceText(ctx)).up()
.add("errors").up()
.add("sheets").up()
.add("license").up()
.add("metas").up();
.add("listing").set(new SourceText(ctx)).up();
}

@Override
public void exitProgram(final EoParser.ProgramContext ctx) {
this.dirs
.xpath("/program/errors")
.xpath("/program").addIf("errors")
.append(this.errors).up()
.attr("ms", (System.nanoTime() - this.start) / (1000L * 1000L))
.up();
Expand Down
9 changes: 3 additions & 6 deletions eo-parser/src/main/java/org/eolang/parser/XePhiListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,7 @@ public void enterProgram(final PhiParser.ProgramContext ctx) {
"time",
ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT)
)
.add("listing").set(new SourceText(ctx)).up()
.add("errors").up()
.add("sheets").up()
.add("license").up()
.add("metas").up();
.add("listing").set(new SourceText(ctx)).up();
if (ctx.object() == null || ctx.object().formation() == null) {
this.objects().start();
}
Expand All @@ -144,7 +140,8 @@ public void enterProgram(final PhiParser.ProgramContext ctx) {
public void exitProgram(final PhiParser.ProgramContext ctx) {
if (!this.packages.isEmpty()) {
final String pckg = String.join(".", this.packages);
this.dirs.xpath("metas[last()]").strict(1)
this.dirs.addIf("metas").up()
.xpath("metas[last()]").strict(1)
.add("meta")
.attr("line", 1)
.add("head").set("package").up()
Expand Down
47 changes: 26 additions & 21 deletions eo-parser/src/main/resources/XMIR.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ SOFTWARE.
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="non-empty">
<xs:annotation>
<xs:appinfo>A non-empty string</xs:appinfo>
<xs:documentation>
The value that is not empty (contains at least one character).
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="empty">
<xs:annotation>
<xs:appinfo>Just empty string</xs:appinfo>
Expand Down Expand Up @@ -75,12 +86,12 @@ SOFTWARE.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="name"/>
<xs:attribute name="base"/>
<xs:attribute name="name" type="non-empty"/>
<xs:attribute name="base" type="non-empty"/>
<xs:attribute name="star" type="empty"/>
<xs:attribute name="as"/>
<xs:attribute name="atom"/>
<xs:attribute name="loc"/>
<xs:attribute name="as" type="non-empty"/>
<xs:attribute name="atom" type="non-empty"/>
<xs:attribute name="loc" type="non-empty"/>
<xs:attribute name="abstract" type="empty"/>
<xs:attribute name="method" type="empty"/>
<xs:attribute name="const" type="empty"/>
Expand All @@ -95,7 +106,7 @@ SOFTWARE.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:extension base="non-empty">
<xs:attribute name="check">
<xs:annotation>
<xs:appinfo>The name of the checker that found the error</xs:appinfo>
Expand Down Expand Up @@ -145,7 +156,7 @@ SOFTWARE.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:extension base="non-empty">
<xs:attribute name="line" use="required" type="whole"/>
</xs:extension>
</xs:simpleContent>
Expand All @@ -162,7 +173,7 @@ SOFTWARE.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string"/>
<xs:extension base="non-empty"/>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="license">
Expand All @@ -174,7 +185,7 @@ SOFTWARE.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string"/>
<xs:extension base="non-empty"/>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="sheet">
Expand All @@ -187,7 +198,7 @@ SOFTWARE.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string"/>
<xs:extension base="non-empty"/>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="meta">
Expand All @@ -207,13 +218,7 @@ SOFTWARE.
</xs:simpleType>
</xs:element>
<xs:element name="tail" type="xs:string"/>
<xs:element name="part" minOccurs="0" maxOccurs="unbounded">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="part" minOccurs="0" maxOccurs="unbounded" type="non-empty"/>
</xs:sequence>
<xs:attribute name="line" type="whole"/>
</xs:complexType>
Expand Down Expand Up @@ -286,7 +291,7 @@ SOFTWARE.
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="name" type="non-empty" use="required"/>
<xs:attribute name="ms" type="whole">
<xs:annotation>
<xs:appinfo>The amount of milliseconds that were spent on creating this document</xs:appinfo>
Expand All @@ -307,7 +312,7 @@ SOFTWARE.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="version" type="xs:string">
<xs:attribute name="version" type="non-empty">
<xs:annotation>
<xs:appinfo>The version of the parser that created the document</xs:appinfo>
<xs:documentation>
Expand All @@ -317,7 +322,7 @@ SOFTWARE.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="revision" type="xs:string">
<xs:attribute name="revision" type="non-empty">
<xs:annotation>
<xs:appinfo>The Git SHA of the release of the parser that created the document</xs:appinfo>
<xs:documentation>
Expand All @@ -337,7 +342,7 @@ SOFTWARE.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="source" type="xs:string">
<xs:attribute name="source" type="non-empty">
<xs:annotation>
<xs:appinfo>The absolute path of the source file that was parsed</xs:appinfo>
<xs:documentation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,28 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="_each" version="2.0">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="_stepped" version="2.0">
<xsl:param name="step"/>
<xsl:param name="sheet"/>
<xsl:output encoding="UTF-8" method="xml"/>
<xsl:template match="sheets">
<xsl:template match="/program/sheets">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
<xsl:element name="sheet">
<xsl:value-of select="$sheet"/>
</xsl:element>
</xsl:copy>
</xsl:template>
<xsl:template match="/program[not(sheets)]">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
<sheets>
<xsl:element name="sheet">
<xsl:value-of select="$sheet"/>
</xsl:element>
</sheets>
</xsl:copy>
</xsl:template>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
Expand Down

0 comments on commit 424237c

Please sign in to comment.