简体   繁体   中英

string-set multiple strings with PrinceXML

With PrinceXML it is possible to use string-set for one variable in one rule:

h1 { string-set: header content(); }
h2 { string-set: subheader content(); }

This is a cool thing and works great, but I want to set subheader for every h1 element, too (because not every chapter has subchapters and subheader would then contain the wrong string)

I already tried the following ideas, but they do not work:

h1 {
  string-set: header content();
  string-set: subheader content();
}
h2 { string-set: subheader content(); }

and

h1 { string-set: header content(); }
h1 { string-set: subheader content(); }
h2 { string-set: subheader content(); }

and

h1 { string-set: header,subheader content(); }
h2 { string-set: subheader content(); }



Is it possible at all to set multiple strings with one element? If yes, how?
PS.: The strings are displayed with the following rules:

@page :left {
  @top-right {
    content: string(header, first);
  }
}

@page :right {
  @top-right {
    content: string(subheader, first); 
  }
}

maybe it's is a bit too late, but it is possible.

In my case I need an old and new attribute of one tag.

p.frontmatter-subtitle {
    string-set: mynew attr(new), myold attr(old);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM