Copy link to clipboard
Copied
Hi all,
I am looking for xml structure for directly applying styles from group style just like aid:pstyle="test", where if there's any style with name test will be applied directly and if there's none indesign will create one.
Do we have any such kind of xml structure for creating and applying style from a group styles?
Thanks in advance
Sunil
My guess is that style groups have been added relatively later (CS4?) than XML import (CS3), and support for them by XML import was just not considered.
I currently see these possible approaches:
Copy link to clipboard
Copied
Which Adobe product are you asking about?
Copy link to clipboard
Copied
I am looking for help in Adobe InDesign XML.
Currently InDesign is having two namespaces as : http://ns.adobe.com/AdobeInDesign/4.0/ for paragraph styles and character styles, And second http://ns.adobe.com/AdobeInDesign/5.0/ is for table structure.
My concern is for how to do it for Group styles (Paragraph style/Character style).
Best
Sunil
Copy link to clipboard
Copied
Moved to InDesign Forum.
Copy link to clipboard
Copied
You don't need to move my question to that forum because I've already asked this question on that forum as well but din't receive any help from that forum.
I put that question on this forum thinking I might get some help from here if somebody is having any idea about that.
Thanks
Sunil
Copy link to clipboard
Copied
It's doubtful. XML has very limited group of people using it in InDesign.
You will have more luck looking for scripts to do what you want if you can be more specific. Ask in the InDesign Scripting forum here:
Copy link to clipboard
Copied
I understand Steve.
I have already asked this question on InDesign Scripting as well.
Hoping for good
Thanks
Sunil
Copy link to clipboard
Copied
@https://forums.adobe.com/people/Steve%20Werner​
I can do that with InDesign JavaScript as well but If there's a xml structure for it why should I write code for the same.
If I don't get that XML I'll be writing InDesign JS only.
But reason behind searching for XML is that importing XML is much more faster than executing JS for applying such styles while going in a loop n all.
Thanks
Sunil
Copy link to clipboard
Copied
please try this code
var myDoc = app.activeDocument;
maptagToparastyle('*')
function maptagToparastyle(xmlElement)
{
ruleSet = new Array (new AddReturns);
__processRuleSet(myDoc.xmlElements.item(0), ruleSet);
function AddReturns()
{
this.name = "MapStyles";
this.xpath = "//"+ xmlElement;
this.apply = function(element) {
if (element.xmlAttributes.item("aid:pstyle").isValid){
var style = element.xmlAttributes.item("aid:pstyle").value
if (myDoc.paragraphStyles.item(style).isValid)
{
element.texts[0].applyParagraphStyle(style);
}
}
}
}
}
Copy link to clipboard
Copied
Hi priyak7746321​,
I am not looking for InDesign JavaScript (I can also write JS).
I am looking for xml structure for Paragraph/Character Group styles Just like there's a namespace for Adobe InDesign for applying paragraph style.
Just add this name space into your xml and import & you don't have write any code, while importing xml only InDesign will apply that paragraph style which is mentioned in that attribute.
If you have any Idea about Group style xml structure please share your knowledge, That would be a great help
Anyway I appreciate your efforts
Thanks
Sunil
Copy link to clipboard
Copied
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
<p aid:pstyle="Ind">
I tried within para style group and its working fine for me.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Take a look at this,
This is before importing myGroup styles is : GroupStyle1
And this is after I imported XML: (Note: New style gets created named as per attributes : GroupStyle1 outside of group)
XML :
<?xml version='1.0' encoding='UTF-8'?><eduxml xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
<p aid:pstyle="GroupStyle1">Test Para For applying Group Style</p>
</eduxml>
If you have something, let me know...
Best
Sunil
Copy link to clipboard
Copied
My guess is that style groups have been added relatively later (CS4?) than XML import (CS3), and support for them by XML import was just not considered.
I currently see these possible approaches:
Copy link to clipboard
Copied
Hi Dirk Becker​,
If xml import wasn't considered I'll leave this thread opened.
I'll write simply a loop of JS to reach my goal.
Thanks you
Sunil
Copy link to clipboard
Copied
other way convert the ICML to BackingStory.xml (idml structure). It may solve the issue.
Copy link to clipboard
Copied
<p aid5:pstyle="TextStyleGroup___Body Indent 1">Here, is your solution.</p>
TextStyleGroup___Body Indent 1
TextStyleGroup: Use group name here
___: use seperator (i have used 3 undersore, you can use any other)
Body Indent 1: Paragraph style
For complete referemce see my post rajesh_kumar4
Copy link to clipboard
Copied
Hi rajesh_kumar4,
I think you did not read my question properly.
I am also able to write JavaScript to apply group paragraph styles, and also able to put 3 or 1000 underscores.
I am also able to write xslt as well.
My concern was is there any direct XML structure exists or not for applying group styles while importing XML like aid:pstyle.
The post your are refering is nothing but you are applying group paragraph styles from javascript, instead it is not applying those styles while importing into InDesign.
So as Dirk Becker​ suggested that this xml structure for group styles was not considered while developing those.
Dirk Becker​ says :
My guess is that style groups have been added relatively later (CS4?) than XML import (CS3), and support for them by XML import was just not considered.
If you have any solution over that please share.
Thanks
Sunil
Copy link to clipboard
Copied
It is beyond InDesign scope right now, for coming version it could be possible yoe may talk to Adobe Developer.
My concern was is there any direct XML structure exists or not for applying group styles while importing XML like aid:pstyle.
Copy link to clipboard
Copied
Yes,
Currently group paragraph styles is not being taken into considaration for XML.
Thanks for your time.
Sunil
Copy link to clipboard
Copied
By the way, have you looked at Adobe FrameMaker?
It can easily apply paragraph and character styles based on XML tags with an EDD.
With a conversion table, it can wrap XML tags based on para/char styles. (Conversion tables are relatively simple to make for most jobs.)
Copy link to clipboard
Copied
Hi,
I am just wondering if any namespaces exists that while importing xml into InDesign, group style should applied.
If no currently I am using JavaScript to do that.
If I can get that XML structure for it, I will get rid off this looping code.
Thanks
Sunil