Allow element use anywhere
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 5
- Joined: Thu Mar 09, 2006 5:45 pm
Allow element use anywhere
Our content creation folks need to be able to specify "hard" line breaks in text elements. My thought was to allow <p/> to appear nested within any element defined in the schema, and then just pass that throgh when transforming the XML to XHTML.
Aside from making everything in the scheuma into a complex type and adding "p" as a valid element, is there another way to support this? I need to stick with XSL 1.0.
Or maybe I should start by asking, "is this the best way to allow for line-breaks in string elements?"
Thanks in advance for your help, suggestions and ideas.
Aside from making everything in the scheuma into a complex type and adding "p" as a valid element, is there another way to support this? I need to stick with XSL 1.0.
Or maybe I should start by asking, "is this the best way to allow for line-breaks in string elements?"
Thanks in advance for your help, suggestions and ideas.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Allow element use anywhere
Post by sorin_ristache »
Hello,
Regards,
Sorin
You have to put p in the http://www.w3.org/1999/xhtml namespace when you define the schema and allow this namespace to pass in the output of the stylesheet.tgolden wrote:My thought was to allow <p/> to appear nested within any element defined in the schema, and then just pass that throgh when transforming the XML to XHTML.
Regards,
Sorin
-
- Posts: 5
- Joined: Thu Mar 09, 2006 5:45 pm
Re: Allow element use anywhere
OK, but unless I misunderstand that doesn't solve my problem. If I don't add "p" to every element in the schema, I still get schema validation errors. Did I miss your point?sorin wrote: You have to put p in the http://www.w3.org/1999/xhtml namespace when you define the schema and allow this namespace to pass in the output of the stylesheet.
To rephrase my question: how can I allow one element (e.g., "p") to appear within any other element that is defined in the schema, without explicitly specifying it inside every element of the schema? Or is there a different type I should be using beside xs:string that would automatically allow common html elements like <p>?
Thanks.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
I think you have two options:
- include p inside every type definition of the schema;
- extend every type definition from one root type definition which allows the p element.
Regards,
Sorin
I think you have two options:
- include p inside every type definition of the schema;
- extend every type definition from one root type definition which allows the p element.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
I think that option has to use a substitution group in a root type which can be substituted by different particles in derived types but the root type would restrict too much the layout of the particles of the derived types. So you should use the first option with including a reference to p inside each type definition.
Regards,
Sorin
I think that option has to use a substitution group in a root type which can be substituted by different particles in derived types but the root type would restrict too much the layout of the particles of the derived types. So you should use the first option with including a reference to p inside each type definition.
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service