Permalink
Browse files

Fix issue #189 by adding href and line attributes to profile elements…

… and making the type of user defined steps more useful
  • Loading branch information...
ndw committed Feb 4, 2015
1 parent 8ec9432 commit 1c100089ddfbf81d2f85608cbdc974f3c9785a77
Showing with 15 additions and 1 deletion.
  1. +15 −1 src/com/xmlcalabash/core/XProcRuntime.java
@@ -152,7 +152,10 @@
private QName profileProfile = new QName("http://xmlcalabash.com/ns/profile", "profile");
private QName profileType = new QName("", "type");
private QName profileName = new QName("", "name");
private QName profileHref = new QName("", "href");
private QName profileLine = new QName("", "line");
private QName profileTime = new QName("http://xmlcalabash.com/ns/profile", "time");
private String p_declare_step_clark = XProcConstants.p_declare_step.getClarkName();
public XProcRuntime(XProcConfiguration config) {
this.config = config;
@@ -961,8 +964,19 @@ public void start(XStep step) {
}
String name = step.getType().getClarkName();
profileWriter.addAttribute(profileType, name);
if (p_declare_step_clark.equals(name)
&& step.getType() != null
&& step.getStep().getDeclaredType() != null) {
profileWriter.addAttribute(profileType, step.getStep().getDeclaredType().getClarkName());
} else {
profileWriter.addAttribute(profileType, name);
}
profileWriter.addAttribute(profileName, step.getStep().getName());
if (step.getStep().getNode() != null) {
profileWriter.addAttribute(profileHref, step.getStep().xplFile());
profileWriter.addAttribute(profileLine, ""+step.getStep().xplLine());
}
profileWriter.startContent();
}

0 comments on commit 1c10008

Please sign in to comment.