Skip to main content



      Home
Home » Archived » Sapphire » Tags with attributes and a simple content
icon4.gif  Tags with attributes and a simple content [message #924921] Thu, 27 September 2012 04:34 Go to next message
Eclipse UserFriend
First, I'd like to thank you all for the GREAT effort you guys do Smile

If I have a Tag like this:

<data keyword="SampleTi">
      <resolution>0.001</resolution>
</data>


I will simply create a class named IData.java:

public interface IData extends IModelElement
{
	ModelElementType TYPE = new ModelElementType( IData.class );

	// *** Keyword ***
	@Label(standard = "&Keyword")
	@XmlBinding ( path = "@keyword" )
	ValueProperty PROP_KEYWORD = new ValueProperty(TYPE, "Keyword");
	Value<String> getKeyword(); void setKeyword(String value);

	// *** Resolution ***
	@Label(standard = "&Resolution")
	@XmlBinding ( path = "resolution" )
	ValueProperty PROP_RESOLUTION = new ValueProperty(TYPE, "Resolution");
	Value<String> getResolution(); void setResolution(String value);
}


but for the Tag:

<data keyword="SampleTi">
      simple content
</data>


I still have to create a class named "IData.java" in order to get the "keyword" exactly the same as the previous example:

public interface IData extends IModelElement
{
	ModelElementType TYPE = new ModelElementType( IData.class );

	// *** Keyword ***
	@Label(standard = "&Keyword")
	@XmlBinding ( path = "@keyword" )
	ValueProperty PROP_KEYWORD = new ValueProperty(TYPE, "Keyword");
	Value<String> getKeyword(); void setKeyword(String value);
}


but now, how can I get the string "simple content"?
Re: Tags with attributes and a simple content [message #924930 is a reply to message #924921] Thu, 27 September 2012 04:44 Go to previous message
Eclipse UserFriend
Try this...

public interface IData extends IModelElement
{
	ModelElementType TYPE = new ModelElementType( IData.class );

	// *** Keyword ***
	@Label(standard = "&Keyword")
	@XmlBinding ( path = "@keyword" )
	ValueProperty PROP_KEYWORD = new ValueProperty(TYPE, "Keyword");
	Value<String> getKeyword(); void setKeyword(String value);

	// *** SimpleContent ***
	@Label(standard = "&Simple Content ")
	@XmlBinding ( path = "" )
	@Whitespace( trim = false )
	ValueProperty PROP_SIMPLE_CONTENT = new ValueProperty(TYPE, "SimpleContent");
	Value<String> getSimpleContent(); void setSimpleContent(String value);
}

[Updated on: Thu, 27 September 2012 04:46] by Moderator

Previous Topic:Sapphire at GitHub
Next Topic:Announcing Sapphire 0.5.3 Release
Goto Forum:
  


Current Time: Mon Jul 14 15:22:04 EDT 2025

Powered by FUDForum. Page generated in 0.27416 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top