<img> tags outside <p>

Kae
Posts: 12

<img> tags outside <p>

Tue Apr 08, 2014 5:01 am

Is there a way to insert an image outside a <p> tag? Currently, there always has to be a <p> tag before an image can be inserted.
sorin_ristache
Posts: 4144

Re: <img> tags outside <p>

Tue Apr 08, 2014 9:59 am

Hello,

In an XHTML file you can insert an <img> element for example in a <body>, in a <li> (inside an <ul> or <ol>), in a <dd> or <dt> (inside a <dl>). You can insert the <img> element using the content completion assistant either in the Text editing mode or in the Author editing mode.

What XHTML code did you try? Where do you want to insert an <img> element?


Regards,
Sorin
Kae
Posts: 12

Re: <img> tags outside <p>

Tue Apr 08, 2014 12:29 pm

I see. I am currently trying to insert an <img> tag within a <content> tag, which is a custom tag defined in an .xsd we're using, though it should be insertable in other tags as well.
sorin_ristache
Posts: 4144

Re: <img> tags outside <p>

Tue Apr 08, 2014 12:44 pm

So that is not an XHTML file? What schema is that? Did you create a custom XSD schema? Where (in what elements) does your XSD schema allow an img element?

If you associate the XSD with the edited XML file using the toolbar action called Associate Schema (also available on menu Document -> Schema) then Oxygen will display all the elements allowed by the schema at the current cursor position with the help of the Oxygen content completion assistant (available in both Text editing mode and Author editing mode).


Regards,
Sorin
Kae
Posts: 12

Re: <img> tags outside <p>

Thu Apr 10, 2014 12:54 pm

It is a custom xsd schema, and the schema allows for insertion of an img tag anywhere.
sorin_ristache
Posts: 4144

Re: <img> tags outside <p>

Thu Apr 10, 2014 1:06 pm

Is the XSD schema ssociated with the edited XML document? What is the schema declaration that associates the XSD schema with the XML document? What does the validation operation say? Does it list any validation errors in an errors view at the bottom of the Oxygen window when you press the Validation button on the toolbar?

Can you post some samples here of your XML file and XSD schema for testing them?


Regards,
Sorin
Kae
Posts: 12

Re: <img> tags outside <p>

Fri Apr 11, 2014 6:28 am

OK, I will send the samples via email to support@oxygenxml.com.

Return to “XHTML”

Who is online

Users browsing this forum: No registered users and 0 guests