Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extent valid character in attribute key name #444

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/demo/resources/demo/simple/consumption_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<setup
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://www.benerator.de/schema/3.0.0"
xsi:schemaLocation="https://www.benerator.de/schema/3.0.0 http://benerator.de/schema/benerator-3.0.0.xsd"
defaultDataset="US" defaultLocale="en_US" defaultSeparator=";">
<memstore id="mem"/>
<generate type="consumplist" count="10" consumer="mem">
<attribute name="id" generator="IncrementGenerator"/>
<attribute name="category" type="string"/>
<attribute name="transactionId" type="string"/>
<attribute name="iso" constant="ISO-8859-1"/>
</generate>
<iterate type="consumplist" source="mem" consumer="ConsoleExporter">
<attribute name="category" type="string" script="consumplist.category"/>
<attribute name="transactionId" type="string" script="consumplist.transactionId"/>
<part name="data" minCount="1" maxCount="1">
<attribute name="ISO_3166-1_NUM-3" type="string" script="consumplist.iso"/>
ake2l marked this conversation as resolved.
Show resolved Hide resolved
</part>
</iterate>
</setup>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class IdParser extends RegexBasedStringParser {

public IdParser() {
super("id", "[A-Za-z_][A-Za-z0-9_]*");
super("id", "[A-Za-z_][A-Za-z0-9_-]*");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,11 @@ public void demoSimpleCities() {
BeneratorContext benCtx = parseAndExecuteFile("/demo/simple/cities.ben.xml");
Assert.assertEquals("/demo/simple", benCtx.getContextUri());
}

@Test
public void demoConsumptionTemplate() {
context.setContextUri("/demo/simple");
BeneratorContext benCtx = parseAndExecuteFile("/demo/simple/consumption_template.xml");
Assert.assertEquals("/demo/simple", benCtx.getContextUri());
}
}